Issues with Bike physics

I’m currently working on a mountain biking game with a short deadline, and I’m having issues with getting the physics right. I have a simple setup with a rigidbody, two wheel colliders, and the car control script from Andrew Gotow, with some adjustments (1:1 gear ratio, etc).

I also added a configurable joint to try to get the bike to always stand up straight, and it works most of the time, but on uneven terrain (we use mesh segments that get placed in random order to create an infinite track) the bike can be erratic. It seems the back wheel comes off the ground and spins the bike around, and other times the bike gets stuck on it’s side. When on smooth terrain, everything operates normally unless the turn radius is too tight at high speed. My guess is it’s related to the mass of the rigidbody and wheels, as well as the friction values of the wheel colliders.

Here’s a sampling of my values:

Rigidbody:
mass: 200
drag: 0
angular drag: 0.05

wheel colliders:
spring: 50
damper: 10
target pos: 0
mass: 50

forward friction:
extremum slip: 1
value: 20000
asymptote slip: 2
value: 10000
stiffness: 1

sideways friction:
extremum slip: 1
value: 20000
asymptote slip: 2
value: 10000
stiffness: 10

I’ve played with these values ad nauseum. Nothing seems to get the bike to control consistently.

Note: for the game we need to make sure the player never turns around. I’m wondering if I should abandon using physics for the game and write all behavior in scripts for full control. I’ve done some experiments (using char controller, scripting movement, etc), and it seems like a lot of work to get it right. Again, my timeline is short, and this is the most important piece of the game. Any words of wisdom?

I would also like to know how to change bicycle script.

There expert know?

FYI, We ended up scrapping the PhysX rigidbody stuff and one of our programmers wrote his own physics and collision. For our simple needs it worked very well.