Front and Facing


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

Try (e.g.):

transform.position = hero.position + hero.forward * distance;