- Home /
Facing Direction
I have an enemy in my game that needs to always be facing the player. I'm sure its something simple, but I cannot for the life of me think of how to do it. I was thinking something along the lines of
transform.Rotate(0, (transform.rotation.y - player.transform.position.y), 0);
would this work?
Comment
Answer by Borgo · Jan 07, 2011 at 08:00 PM
Try the LookAt function.
http://unity3d.com/support/documentation/ScriptReference/Transform.LookAt.html
Your answer
Follow this Question
Related Questions
Change characters direction using camera view 0 Answers
Model is facing the wrong way 1 Answer
Control object yaw by two axis 1 Answer
Change Facing Direction 4 Answers
Finding relative mouse position 2 Answers