I’m working on a kart game, and I want to be able to play with the gravity. I have a simple box with cylinders fitted with wheel colliders. I have turned off the ‘useGravity’ and tried various methods to apply custom gravity, such as rigidbody.AddForce, as well as a ConstantForce component. First I set them all to the same value as the default physics.gravity, then I tried other numbers. When using this custom gravity the kart does not respond well at all: bumping, sliding, turning in odd directions.
Here is one example the relevant code:
function Update(){
ApplyGravity();
}
function ApplyGravity(){
rigidbody.AddForce(-Vector3.up*Physics.gravity.magnitude);
}