Brakes not working when reversing using modified unity standard asset car

I am building a simple driving game using a logitech G29 steering wheel

I met an issue where I can’t brake when the car is in reverse. The only way I can brake is release the reverse key, press on the accelerator and it will work normally again.

I uploaded my code due to the forum does not let me post it fully
I made modifications at line 219 and 243.

Thank you.

6109793–665189–CarController.cs (14.4 KB)

Begin by liberally sprinkling Debug.Log() statements all over the parts of the code that are supposed to back you up or apply brakes, and see if any or all of that code is actually running.

Once you determine it is actually running, then start to print values out that are used for deciding to brake, how much to brake, etc. and debug it all the way back to where the values are wrong.

2 Likes

Ok, will do that, thanks for the reply

I found out a funny bug where if the car is in any form of movement that is not forward, like rolling backwards or in reverse, the brakes just don work, so apparently if the car motion is backwards, the brakes will not work.

I will add Debug.Log() and see where goes wrong