I am working on a prototype where I would like to move a car by pushing it on the sides with an AddForce function.
However, when the car is at a complete stop, I can’t move it as I want, the springs seem to absorb everything (first two clicks on the video). But ifI apply a small motorTorque force to the front wheels (0.01f before the last two clicks) then the movement seems to work properly…
I’m very new with wheel colliders and I cant’ find what is the variable/function that causes this change in behavior depending on whether or not a motorTorque is applied?
It is likely that the behavior you are observing is caused by the WheelFrictionCurve properties of the WheelCollider component. The WheelFrictionCurve is a set of values that determine how the WheelCollider responds to forces, including the stiffness of the suspension, the amount of grip, and the behavior of the brakes.
When the car is stationary, the stiffness of the suspension (represented by the extremumValue property of the WheelFrictionCurve) is likely too high, causing the springs to absorb the forces applied to the car. However, when you apply a small motor torque, the car begins to move, and the stiffness of the suspension decreases, allowing the car to be pushed more easily.
To fix this issue, you can try adjusting the WheelFrictionCurve properties of the WheelCollider components on the car. In particular, you may want to try decreasing the extremumvalue property, which determines the stiffness of the suspension, or adjusting the asymptoteValue property, which determines how much grip the wheels have on the ground.