[UPDATE] If you are looking for the breaking bugfix check the description after expanding it!
Let’s learn how to create a car controller in Unity. We will get to know Unity’s wheel collider component and use it to move a car. We will also create a simple camera script that will follow the car.
[BREAKING BUGFIX!!]
There is a bug in the HandleMotor() method in the CarController.cs. The "if (isBreaking) check should be removed. The fix is also pushed to the GitHub repository. The method should look like that:
private void HandleMotor()
{
frontLeftWheelCollider.motorTorque = verticalInput * motorForce;
frontRightWheelCollider.motorTorque = verticalInput * motorForce;
currentbreakForce = isBreaking ? breakForce : 0f;
ApplyBreaking();
}
Used assets:
ARCADE: FREE Racing Car
https://assetstore.unity.com/packages...
by: iMENA Games
https://assetstore.unity.com/publishe...
Grab the whole project from GitHub:
https://github.com/GameDevChef/CarCon...
On this page of the site you can watch the video online Simple Car Controller in Unity Tutorial with a duration of hours minute second in good quality, which was uploaded by the user GameDevChef 09 June 2020, share the link with friends and acquaintances, this video has already been watched 344,408 times on youtube and it was liked by 6.4 thousand viewers. Enjoy your viewing!