Download

Arcade racer two wheeled vehicles

Hi everyone!

I’m working on a little prototype for an arcade racer.
I want to use small, thin vehicles like a skateboard or scooter however I’m having some issues with the physics implementation.
The vehicle setup is done by adding forces and a raycast suspension system which works greatly for me when I use the axis constraints on X and Y and animate the vehicle

However, this implementation only works when driving on flat surfaces. If I want to have crazy roads that go up and down this option won’t work.
My idea for this was to align the vehicle with the up vector of the road. I’d probably have to do this every frame but I can’t seem to add manual rotations when the physic system is active.

The other idea is to stabilize the vehicle to the surface normal by adding torque rotation but I’m afraid the vehicle will still sometimes flip over which absolutely can’t happen(at least at this stage).

The most ideal solution for me would be if I could limit the axis movement on both X and Y instead of locking them(cone movement). A similar approach as you would have with skeletal constraints.

Can anyone give me some direction for how I should best approach this? C++ solutions are fine as well :slight_smile:

Thanks