Quantcast
Channel: Questions in topic: "wheelcollider"
Viewing all articles
Browse latest Browse all 490

Wheel collider physics - something I'm missing?

$
0
0
I am setting up vehicles to drive round a course using waypoints. Each waypoint has a speed associated with it that the vehicle reads and then works out the acceleration/deceleration needed to pass through the waypoint at that speed. I am using the standard equation (v^2 = u^2 + 2as) and all the maths works out fine, pulling in the rigidbody mass and using the current distance etc, etc. to work out the torque to apply. Here's the problem: acceleration works fine but when I want to decelerate, everything goes wrong. Example: I want to bring the car to rest at the next waypoint. which is about 35 metres away but when I apply the brakeTorque, it stops in less than a metre. The torque value is absolutely correct when I work it out by hand, and I am dividing it by 4 to apply it to all 4 wheels evenly. When I disregard the manual and use negative motorTorque instead (same calculations) it works fine, and it also drives much more smoothly the rest of the time, such as when the brakes are applied to correct for an over-speed condition. Is there something about the physics engine I am not understanding? How is brakeTorque meant to be used on a wheel collider?

Viewing all articles
Browse latest Browse all 490

Trending Articles