I’m making racing game and I want to implement car acceleration time, it is acceleration time 0-100 kmh
how to implement it?
for example if I have in my json data property "acceleration": 3
which means 3 seconds, so what parameters I must adjust?
Generally I mean to use physics, I’m using standard assets car prefab based custom model
And see 2 possible ways:
to experiment with parameters
or map the acceleration time from json data with some method
ok so I apply the same force but
for one car add smaller mass so then it accelerates faster
and for second car add higher mass so then accelerates slower
I think this is the temp solution
The AddForce method comes with an optional parameter “forceMode” that you can set to ForceMode.Acceleration. This makes acceleration independent of the rigidbodies mass. The mapping you need for 0-100km/h to seconds is: