- Home /
Findinga GameObject Transform
Hi i want to find a gameobject location for a script that make a camera follow my character for a FPS, so i figured out that i will make the camera transform values to be the same as my character except for the Y which will be the Y value of the character + the distance between his head and his foots.
But i don't know how to get a transform value.
Thanks i googled it but didn't find something sorry for that.
Answer by clunk47 · Nov 13, 2013 at 10:55 PM
var player : Transform = GameObject.Find("Player").transform;
function Start()
{
print(player.position);
}
Do some homework using the Unity Script Reference HERE.
Thanks will try it I'm still new to unity so i don't know where to begin i will visit your link thanks again.
Since you're new, I'd bookmark the Unity Script Reference page for future reference, whenever you hear any Unity class ter$$anonymous$$ology used, it really comes in handy. Also, Here is a really great place to get started. I'd also happily recommend having a look at Unity Cookie. Hope this helps you get started :)
Already done a bit of tutorials the basic one, they're usefull but unity cookie seems amazing.
Hope i will be able to one day realease my 3D medieval fps game, the road will be long and i might give up but at least it will be fun :D
Thanks a lot :)
Your answer
Follow this Question
Related Questions
smooth fps movements using joystick 1 Answer
2 in 1 question - Enemy transforms and Frames per second 0 Answers
Avart Fate with Gun Movement 0 Answers
Rotation/position question. 1 Answer
Where can I see rotation value from transform.RotateAround? 0 Answers