Jump to content

Unity Car Movement Help

Agena_

Hi, i have this car in unity.

got a movement script, as u can see in images. I have also attached a video on how it looks

 

the problem is, lets say im accelerating, and want to BRAKE. the car will take SOOO long to come to a standstill. How can i get this shorter? i tried adapting f values in the script, but not sure

 

image.png.368db9cc0ba5be31e5e3c78131bbf162.pngimage.png.579a4f95d13a9aee92adeac3482cc713.pngimage.png.3797de1412ec0ea27f4878ba83654fd9.png

Link to comment
Share on other sites

Link to post
Share on other sites

I assume you noticed that the `public float breakForce = 100f;` isn't actually being used on line 54. Not super familier with Unity but  you could try setting a negative motorTorque or value far exceeding "3500f". Or could be something to do with the "Slip based friction model" -> https://docs.unity3d.com/2020.1/Documentation/ScriptReference/WheelCollider.html

Link to comment
Share on other sites

Link to post
Share on other sites

You should set motor torque to 0 when braking. Otherwise you will apply a braking force but continue to apply power whilst braking. 

Link to comment
Share on other sites

Link to post
Share on other sites

On 6/25/2021 at 10:27 PM, AnotherMax said:

I a

 

28 minutes ago, FlappyBoobs said:

You

 

also does anybody know why my wheels spread out, before i hit play the wheels are in the right place. 

but as soon as im playing, the wheels move out more. why is that?

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×