If you are really trying to simulate wheels spinning to accelerate the car, be aware that you will soon run into all kinds of physics stability limitations as the wheels spin faster and faster.
To this end the default limit to Unity’s angular rotation on a Rigidbody is only about one revolution per second (7 rad / second), no matter how much torque you apply to it. That’s to keep things stable.
You can tweak this limit on your wheels:
I quote from the above documentation:
The maximimum angular velocity of the rigidbody measured in radians per second. (Default 7) range { 0, infinity }.
The angular velocity of rigidbodies is clamped to maxAngularVelocity to avoid numerical instability with fast rotating bodies. Because this may prevent intentional fast rotations on objects such as wheels, you can override this value per rigidbody.
EDIT: The Very Very Valet (for Nintendo Switch) guy made a REALLY cool vehicle physics tutorial here. No wheel colliders, just forces to simulate it all.
how can my car turn left or right no matter forward or reverse? My tyre can turn left and right but when i turn my car wheel but my car cannot move either forward or reverse. I am doing using joystick(bluetooth controller for VR application). Here is my C# script.
Hi, i see you problem right there, i don’t know if you still need a solution for that or if you found one in 2 years, lol. So i had the exactly same problem as you and found out that it’s because of the script, of course this is a common car controller script that many people use, but if you need more control over the acceleration you can use this script instead;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ACC : MonoBehaviour
{
public WheelCollider[ ] wheels;
public float motorPower = 100;
public float steerPower = 100;
void FixedUpdate()
{
foreach (var wheel in wheels){
wheel.motorTorque = Input.GetAxis(“Vertical”) * motorPower;
}
GetComponent().maxAngularVelocity = 10000;
for (int i = 0; i < wheels.Length; i++)
{
if(i < 2)
{
wheels_.steerAngle = Input.GetAxis(“Horizontal”) * steerPower;_ } } } } -------------------------------------------------------------------- this script has the main things but also can be better, you can know how to get it better in this video https://www.youtube.com/watch?v=f_ZO2gv4_z0 by pablos lab.