- Home /
How do I Instantly stop wheels (WheelCollider) from moving ?
I'm using the Unity Standard Assets car on a race track and made it so that if you hit the wall, you respawn. I do this by setting transform.position
to the spawnpoint (Vector3) and setting velocity
and angularVelocity
to 0.
Problem is that the car basically cancels its speed, but the wheels are still moving causing the car to still drive a slight bit on respawn. Another thing is that it feels like the car keeps its added force, because it becomes much easier to accelerate from respawn than from start.
I tried setting motorTorque to 0, but this didn't work. I also tried setting brakeTorque to Mathf.Infinity. This works, but I won't be able to directly move forward again. (And if I set it to the initial brakeTorque after, the wheels will still spin).
So does anyone know how to instantly stop moving the car or fully reset the car gameobject after which I can drive as I would on start?
If you still don't get what I mean, here's a video:
https://www.youtube.com/watch?v=8V2sX9BhAW8
I'm basically trying to make my own version of that project.
Your answer
Follow this Question
Related Questions
Best way to make wheels freely turn / swivel? (Like a shopping cart) 2 Answers
Front wheel rotates in play mode 1 Answer
WheelCollider Setup from car? 0 Answers
C# WheelHit.force display wheel suspensions on meshes 0 Answers
Vehicle issues. 0 Answers