Raycast vehicle suspension not stabilizing

kircakirca Posts: 2Member
in 3D

I am trying to implement basic arcade like vehicle physics (i.e. Mario Kart, Crash Team Racing, ...) but I am not able to get the suspension working right. I am not using the built-in VehicleBody as that one seems much more complex than what I need and also I would like to extend this to work for motorcycle vehicle types later.

My main inspiration is the approach described in this video (@2 min.).

That works well but the suspension never stops bouncing so from additional research I found out that there should be a "damper" component to the force calculation. Using the velocity as a countering component seems to be going in the right direction at start, but the spring never stabilizes and the force that accumulates throws of the vehicle completely (video).

The script that I am using for the raycast suspensions (and test scene) can be seen here.

Any help, hint or feedback whatsoever is highly appreciated!


Tags :

Best Answer

  • kircakirca Posts: 2
    Accepted Answer

    I solved it using a combination of suspension specific damping + constant linear and angular damping on the rigid body vehicle. Ideally the damping on the suspension would be enough to stabilize the vehicle and not do that with "global" damping which will affect the driving all the time. I think that the main issue is with the angular velocity but I can't find a way how to include that in the suspension force calculation. The driving feels quite descent though so I guess it will do for now. Anyone interested can check/follow the progress on github.

Answers

  • kircakirca Posts: 2Member
    Accepted Answer

    I solved it using a combination of suspension specific damping + constant linear and angular damping on the rigid body vehicle. Ideally the damping on the suspension would be enough to stabilize the vehicle and not do that with "global" damping which will affect the driving all the time. I think that the main issue is with the angular velocity but I can't find a way how to include that in the suspension force calculation. The driving feels quite descent though so I guess it will do for now. Anyone interested can check/follow the progress on github.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file