I have searched on google and the unity answers site and still haven't found a solution that works yet.
I would like the head of my enemy character to only move -+90 degrees. So like a normal person. Now it just rotates 360 degrees and it is not natural. Is there any simple and safe way to do this.
This is what I have already:
public Transform head;
//.... underneath is in an update function
Vector3 playerPos = new Vector3(player.position.x, head.position.y, player.position.z);
head.LookAt(playerPos);
If anyone could help that would be great thank you
↧