I want to do something like this:
- I have a Player;
- I have a enemy;
- The enemy smooth look at the player
How can I get the rotation of the enemy based on the player position?
In others words, I want to get 0 angle when the enemy is exactly facing to the player.
I try this but doen't works as I expect:
var rot : Quaternion; rot.SetFromToRotation(transform.position,target.position); print(rot.y - transform.rotation.y);