I have these mannequins that i want to keep stationary, but have the heads follow the players movement, i would prefer to have it triggered when enter the area they are in and stop when you exit resetting to original position any suggestions?
Typically you should have a collider on the ground marking the area. That should be marked as Is Trigger then use OnTriggerStay
to move the head. If the head is set up correctly (forward is the local Z axis) then something like headTransform.LookAt(player.Transform;
should work.
As for resetting, headTransform.Rotation = quaternion.Identity
may do the trick in OnTriggerExit
. Otherwise, just read Rotation on OnTriggerEnter
and reset in OnTriggerExit
.