This is my code, and the effect is either an instant rotation if the t variable (Time.deltaTime) is set to anything above zero, or no rotation if it’s zero.
I’m using this instead of transform.lookat because transform.lookat doesn’t work in 2d correctly, by the way.
The rotation is usually being updated per-frame, that’s why I’m using Time.deltaTime. I want the smooth change in rotation. It’s worked before with Vector3.lerp like this.
Read the thread I linked to about why using Time.deltaTime as the third parameter is mathematically incorrect and does not work. It may seem like it works, but in fact it runs differently on different machines and therefore should not be used. To quote from a post there, “You should never pass a linear multiple of delta time as the lerp argument, it doesn’t make sense, it is simple but mathematically always wrong. Assuming you want the behaviour of moving swiftly towards a point but slowing down on the approach, and you want correct compensation for delta time, you ought to use 1 - exp(-k * dt) as the lerp argument, and tweak k to control the rate.”
Anyway you can bypass the issue by using a 2D lookat method; see the other link I posted.