Torque works too much

Hi all,
I’m having a small issue with the script to add torque. I set up everything ad when I press play on unity the snowboarder is too slow for a while then it increase the rotating speed and it start the loop of death.
I can’t figure it out why is increasing and if I restart with finish line or by hitting the ground, it keep the last speed. I was wondering to set the initial speed on the start method but still it doesn’t keep the speed but it is a sort of acceleration.
Hope I was clear enough. Thank you

Hi Guazzo,

Welcome to our community! :slight_smile:

Maybe there is no “air drag”. That would explain why the snowboarder keeps rotating. In the Rigidbody2D component, increase the angular drag value. Start with a rather high value to see if the behaviour improves or changes. If it does, adjust the value until you are happy with the result.

Did this help you fix the problem?


See also:

Hello Nina,
thank you for your support but still has the same issue.
Here is my player inspector and script


I set 100 to the angular drag value and the player does not rotate at all. If I set 20 or something, it start rotating really slow and after a while it start its loop of death (it is like the speed is increasing constantly).

Your screenshots look fine except for one little detail. Do you use Visual Studio? If so, the colour of MonoBehaviour might indicate the problem. Actually, MonoBehaviour is supposed to have the same colour as PlayerController. It might be that there is an internal problem in Unity or VS which prevents your game from working correctly.

Check your console, are there any error messages?

If not, please go to Edit > Preferences > External Tools and click “Regenerate project files”.

Install and use Visual Studio (Community Edition). For some students, VS Code simply does not work well. Maybe due to a problem with Unity, some update or whatever.

If that didn’t fix it, please follow this instruction. Maybe the “Visual Studio Editor” package is missing in your Package Manager, or something else is missing.

I’ve fixed an issue on the installation of unity. Everytime opens, it lose the default external editor. I have regenerate the code after the re-installation of all packages. Nothing change.
I will try by using another editor instead of Visual Studio, just to be sure that the issue isn’t there.

Where did you save Unity and your project? Please share the exact path here. If it contains personal information, you may censor it.

The entire path must contain “English” characters (A-Z, a-z, numbers) only. If there are any special characters it might be that Unity cannot process the data correctly. That’s a known problem.

The path is the following:
D:\01_Progetti\02_UNITY\2D-Example\SnowBoard
It can be the “_” in the path but I don’t know because there are other stuff stored in the same way and they are working properly.

Your path looks fine. Is D:\ an internal harddrive? If so, I don’t see any problem there.

Unity needs full access rights and enough free space to be able to create its Temp files and to save files properly.

Yes is a second drive installed inside the PC. I don’t think the issue is there. I’m start thinking there is something buggy in the installation of unity because also by changing the script editor, nothing change.

Which version of Unity do you use?

If you cannot find the problem and if strange things happen with the editor itself, reinstalling Unity is usually a good idea. If you use an older version, it might also be that you are experiencing a bug. In that case, I’d suggest to install a newer version.

Ok I have updated to 2021.3.17f1 LTS but is still the same. I think there is something wrong in what I have done but I can’t figure it out what.

Could you please fill out our form and send me your zipped project (without the Temp and Library folders)? Don’t forget to add a link to this thread.

When you are done, drop me a line here, so I can check our list.

Everything uploaded :slight_smile:

I’ve just downloaded and tested your game. It’s working fine for me in Unity 2022.1.24f1.

However, the Player Torque value of “Chad” in the Hierarchy of Level 1 is set to 20. That’s a bit fast. Adjust the value until you are happy with the result.

image

Did you change this value to 20 after you shared the screenshots here in this thread? If not, I don’t know where to find the broken(?) Chad. There is only one scene in the project I downloaded.


For future reference, please make sure not to upload the Library with your project. It took me more than an hour to download, unzip and open your project. Usually, this should not have taken longer than 10 minutes.

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

Privacy & Terms