I’m kind of new to this.
it’s a 2d scenario, I’m using “lookRotation” to make the local Z axis look at the sphere.
The sphere and the axis are in the same Z position, however when the sphere passes over the axis the direction of the local Y axis changes its direction to the opposite side immediately.
How can I make the local Y axis keep its original direction?
this is my code:
Vector3 direction = lookAt.transform.position - this.gameObject.transform.position;
this.gameObject.transform.rotation = Quaternion.LookRotation(direction);