Search Unity

Question How to rotate a wheel on his own axis depending on the speed (without a wheel collider)

Discussion in 'Physics' started by AlexNikolay, Apr 12, 2023.

  1. AlexNikolay

    AlexNikolay

    Joined:
    Mar 1, 2022
    Posts:
    29
    Hello, so im trying to make a car based on Physics, that means that im not using a wheel collider, and the main movement including the suspension is raycasts and im only using a rigidbody on the main structure of the car, not in the wheels. So my cuestion is how to rotate the wheels on their own axis depending of the speed of the car. I already figured out how to make the wheels go to the correct position, now the only thing left to do is how to rotate the wheels.

    I hope someone helps me :)
     
  2. Reaktion

    Reaktion

    Joined:
    Nov 8, 2019
    Posts:
    53
    I do believe you can find the answer to your question here :
    https://gamedev.stackexchange.com/a/120862

    I think you want this calculation to be done inside FixedUpdate(), so don't forget to multiply your rotation value by Time.fixedDeltaTime. (since the rotation value is per second)