Slow/weak torque?

Hi,

I’ve followed Rick’s instructions and values in Unity, but he seems to have way more torque than I do. I can barely rotate Barry 180 in a big jump while he can control him even riding on a flat surface.

What have I missed here?

image

Thanks in advance!

Hi Nukem,

Welcome to our community! :slight_smile:

Have you already tried to decrease the Angular Drag in the Rigidbody2D component a bit? Maybe start with a value closer to the default value, then increase it slightly until you are happy with the result. Since each game is unique, it is unlikely that Rick’s values work well for every single student. You have to tweak the values a bit to get a pleasant result in your game.

Did this help?


See also:

Hi Nina,

Yeah changing the Angular Drag works but I thought we were supposed to get the same results from the same values, so I defaulted to thinking I had missed something here.

Perhaps this is because we didn’t set up delta.Time in this project?

Yes and no. For the Rigidbody2D things, we actually must not use Time.deltaTime because the physics simulation takes care of the framerate in this case. Furthermore, the Rigidbody2D things are supposed to be executed in the FixedUpdate() method, not in the Update() method. Rick wanted to keep things simple, though, and, usually, that’s fine. However, if you still experience issues with the rotation, I would recommend to rename the Update method to FixedUpdate.

Bear in mind, though: Execute Rigidbody2D things in FixedUpdate(), not everything there is. Also do not use Time.deltaTime in FixedUpdate(). In this particular case, it’s okay to call GetKey in FixedUpdate(), so don’t worry about that.

If Rick uses the Update() methods for other things than the Rigidbody2D, you can add the Update() method again, and do what he does. However, don’t use empty methods because they are a waste of resources.

(Sounds a bit confusing? Well, that’s probably the reason why Rick used Update() instead of introducing FixedUpdate(). ;))

1 Like

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

Privacy & Terms