Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Oh... you're right. I did use AddRelativeForce... but I imagine that while debugging the initial "stuckness" of the car I changed it to AddForce and never back. Thank you.

Did you also have this issue of the car being stuck at first - video? Any solutions for that?

(3 edits) (+2)

I just set the high "Horse Power" (25000). For this course, this is an acceptable solution.  I was interested in this question and I found a good video demonstrating the implementation of the car.


As a quick fix, I used WheelCollider.motorTorque:

// Remove force from the car
// playerRb.AddRelativeForce(Vector3.forward * horsePower * forwardInput);
// Add motor torque to the wheels
foreach (var wheel in wheels)
{
    wheel.motorTorque = horsePower * forwardInput;
}

This gives a more correct behavior to the car.

Sorry for my English, I use Google Translate :)

(1 edit)

Great job man! I was not in the mood then to look for other solutions, but this is great. And it makes so much sense... if you use Wheel Colliders to add torque to the wheels instead of Force to the car.

Kudos to you for this! Thank you!

I added your suggestion and reference to the YouTube video and my original comment on the Unity course

You deserve the reference.