how to get y angle between two objects unity code example
Example: check the angle between two game objects unity
Vector3 dir = GameObject1.position - GameObject2.position;
float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;
Vector3 dir = GameObject1.position - GameObject2.position;
float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;