Hi there,
In my previous 2D project built with Unity 2021, I frequently used the following script to rotate an object toward another object:
transform.right = other.transform.position - transform.position;
However, I’ve noticed that in Unity 6, this method often doesn’t work. Instead, I now need to use the following code:
Vector2 direction = (other.transform.position - transform.position).normalized;
float angle = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg;
transform.rotation = Quaternion.Euler(new Vector3(0, 0, angle));
Has something changed in Unity 6 or 2022 that affects this behavior? Could there be a specific setting causing this issue, or is it potentially a bug?
My Unity version: 6000.0.3f1 for Mac silicon version