0
\$\begingroup\$

I am trying to simulate a car in Unity, the slope of the road is high so the car slips backwards. Is there any physics property which can stop this from happening?
Thanks in advance.

\$\endgroup\$
  • \$\begingroup\$ How is the car resisting the backward force? Is it in drive, or are you trying to simulate a parking brake? How do you handle moving the car at the moment? \$\endgroup\$ – DMGregory Dec 12 '18 at 11:42
  • \$\begingroup\$ Have you checked out Physics Materials by any chance? \$\endgroup\$ – Gabriele Vierti Dec 12 '18 at 11:47
  • \$\begingroup\$ @DMGregory I am trying to simulate a parking brake, the car stops where it is suppose to and motortorque equals to zero but since the road has a slope, the car slides backwards. \$\endgroup\$ – D.g Dec 12 '18 at 12:25
  • \$\begingroup\$ Have you checked out all the properties in Rigidbody section of Unity? I think this page could just have what you're looking for by default: docs.unity3d.com/ScriptReference/Rigidbody.Sleep.html (if it does, please come back and write your answer so that we can upvote ;) ) Also see the Sleeping section in this link: docs.unity3d.com/Manual/RigidbodiesOverview.html \$\endgroup\$ – John Hamilton Dec 12 '18 at 12:40
1
\$\begingroup\$

When in park you could mark as kinematic, or a better solution may be increasing the angular & linear drag on the rigidbody to stop it from sliding.

That will also help if there was a collision to the car during runtime. it would drag along from the impact force rather than go flying off at impact speed.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.