- Home /
Front and Facing
Hello-
I have a npc that needs to walk to the 'front' of the player no matter which way the player is facing.
This is wrong but here's the basic idea-
transform.position = hero.rotation.y + 3;
basically I am trying to tell the npc to 'be at the hero's z (front) plus 3'
thanks for any help
Answer by Jesse Anders · Dec 14, 2010 at 10:55 AM
Try (e.g.):
transform.position = hero.position + hero.forward * distance;
Thanks a bunch! I tried to throw forward in it before but I didn't think to add the position at all. I appreciate your help.
Your answer

Follow this Question
Related Questions
Instantiate VS placement in editor 0 Answers
Unfreezing rotation causes the position and rotation go crazy 0 Answers
Spwan and shoot bullet in direction of shooter? 2 Answers
How would I rotate an object without moving one of its faces (locking it) 0 Answers
!CompareApproximately (det, 1.0F, .005f) 2 Answers