Another rotation "solution"

Just for funsies, here’s another way to do the rotation script if you don’t like the way Lerp looks. The bolded parts are things that I changed or added. This uses something called SmoothDamp instead of Lerp or moveDirection.

[SerializeField] float rotateSpeed = 5.9f;
Vector3 velocity = Vector3.zero;

transform.forward = Vector3.SmoothDamp(transform.forward, moveDirection, ref velocity, Time.deltaTime * rotateSpeed);

rotateSpeed = 5.9f is about the slowest (lower number = faster movement here) that I could make this look good. Once you hit 6-7f, the model starts doing the moonwalk backward if you click directly behind it.

My very limited understanding of how this works is that it makes the motion slower at the beginning and end of the animation, so that it looks and feels snappy without looking like you’re instantly rotating like moveDirection does.

I think you could use Mathf.SmoothDamp to play with the actual rotation speed, but that’s a bit over my head at the moment.

Privacy & Terms