Unity 2d rotate to face the player at a constant speed

I’ve been looking on the forums and can’t find quite what I need for help. What I want is for my turret to rotate so that it is facing the player, but do so at a constant speed. I also need to ensure that it only does so within a specific range so that the turret doesn’t go into the ground. Everything I have seen so far doesnt fix the issue of speed. No matter what I try the turret will always rotate faster the greater the angle it needs to rotate is. I want to ensure that no matter how far it needs to rotate it will always do it at the same speed.

Mathf.MoveTowardsAngle could help

You’ll have to give it the current angle, the target angle and the maxDelta.
It takes every Angle as a float.
maxDelta represents the the “Jump” you can make each time its called so you can insert your Angle/second and multiply it by your fixedDeltaTime (assuming you use this in the FixedUpdateMethod).

The result is your new Angle.

Edit: when you are below the Turret you can try to make the code pretend you are at the same y-level as the turret.


Look for some quaternion rotation tutorials. It should work even if it’s 2D as you can ignore the 3rd axis. You may have to use some intermediary Vector3 for the calculations if you’re only using Vector2. You will also want to use a rotation speed along with deltaTime to keep the speed steady. Here’s a quick tutorial about quaternion rotations:

What you say BLVDE seems to be closer to what I want, but how would I find what angle I need it to rotate to?