Obstacle Course: Rotate an Object - Time.deltaTime?

I posted this question earlier asking why ‘Time.deltaTime’ was not used on the rotating ‘spinner’ in the Obstacle Course game.

@Nina pointed out that ‘Time.deltaTime’ is not included in Unity Scripting reference for this case.

Interestingly I found an example today in a Packt> book I am also following called Learning C# by Developing Games with Unity where the author includes ‘Time.deltaTime’ in the rotation speed of the player object using -

void Update()
    {
        vInput = Input.GetAxis("Vertical") * moveSpeed;
        hInput = Input.GetAxis("Horizontal") * rotateSpeed;

        transform.Translate(Vector3.forward * vInput * Time.deltaTime);
        transform.Rotate(Vector3.up * hInput * Time.deltaTime);   
    }

Hi Rory,

Did you just want to share your code and talk about it or do you have a problem that you would like to solve?

This is a forum right? An open discussion where we learn from our experience?

I think I selected the ‘talk’ tag right?

Usually, we use the “Talk” subforum for general discussions. If your goal is to talk with other students, for example, about the pros and cons of your approach, the “Talk” subforum is the right place. :slight_smile:

If you need help with the content of our course(s), the “Ask” subforum is where your thread should be because we teaching assistents mainly check the “Ask” subforum. I noticed your thread by chance because it appeared on the front page for a brief moment when I was online.

Privacy & Terms