I’m making a 3d game and I have an AI that looks at the player. The problem is that the AI stays in the idle animation while it is turning to face the player. Is there away to detect when the AI is rotating and then play the turn around animation instead of the idle animation?
You shouldn’t use a rigidbody on something moved by transform, and shouldn’t use the transform of something with a rigidbody.
The first step would be to fix that, and call rigidbody.MoveRotation in FixedUpdate instead of setting transform.rotation.
Once that is done, simply store the previous rotation before updating it. Then calculate the angle between the new and the old rotation using Quaternion.Angle. If the angle is more than a certain amount you chose, then movement was detected.