Answers for "enemy look at player unity 2d"

C#
0

enemy look at player unity 2d

Vector3 dir = enemy.position - transform.position; 
 float angle = Mathf.Atan2(dir.y,dir.x) * Mathf.Rad2Deg; 
 transform.rotation = Quaternion.AngleAxis(angle -90, Vector3.forward);
Posted by: Guest on May-01-2020

Code answers related to "enemy look at player unity 2d"

C# Answers by Framework

Browse Popular Code Answers by Language