Tying rotation speed to framerate?

I’m wondering why rotation speed is not normalised to deltaTime like player movement speed? Wouldn’t hard coded 0.5 spin really slowly on an old laptop? What I did was:

public class Spinner : MonoBehaviour
{
    [SerializeField] float degreesPerSecond = 80.0f;

    // Update is called once per frame
    void Update()
    {
        float degreesPerFrame = degreesPerSecond * Time.deltaTime;
        transform.Rotate(0.0f, degreesPerFrame, 0.0f);
    }
}
1 Like

Hi,

Without seeing your code for the player’s movement, I’m afraid it is impossible to answer your question. Generally, we distinguish between Transform methods and Rigidbody methods. The latter send data to the physics simulation which takes care of movements, collisions and also the framerate-independency within the physics simulation.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms