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

Limiting the speed of my car

$
0
0
Hi, I've searched everywhere but didnt get an answer for this, how do I limit the speed of my car? my if statement doesnt work in `function Update()`. My code: function Update() { if (currentSpeed > topSpeed) { maxTorque = 0; } else if (currentSpeed <= topSpeed) { maxTorque = maxCurrentTorque; } else { Decel(); } } maxTorque is my variable to hold the motorTorque of my WheelColliders, and maxCurrentTorque is a variable whose value is taken by the maxTorque after the speed is below the limit. Thanks

Viewing all articles
Browse latest Browse all 490

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>