• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Dreave · Jan 14, 2012 at 05:40 PM · rotationcar

How to stop my car tipping over?

I have a rigidbody on my car that works fine but I have stacks of tires which you can collide with, that tips my car over, is there anyway to freeze its rotations or something? Can anyone help me?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by FLASHDENMARK · Jan 14, 2012 at 06:33 PM

Under your rigidbody component exist a tab called "Constraints". Under Constraints you are able to freeze each individual rotation axis. Try messing around with them and see what happens.

NOTE: I believe the constraints only constraints physics behavior. So if you are rotating your car with transform.Rotate();(non-physics behavior) or alike then it will not constraint the rotation axis.

Increasing the mass of the vehicle may also help.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dreave · Jan 14, 2012 at 11:21 PM 0
Share

Ive figured it out now thanks for your help.

avatar image
3

Answer by Omee143 · Feb 16, 2016 at 04:13 PM

this.rigidbody.centerOfMass = new Vector3 (0, -0.9f, 0);

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tanoshimi · Feb 16, 2016 at 06:47 PM 0
Share

How is this see$$anonymous$$gly arbitrary line of code relevant to a four-year old already answered question?

avatar image Borisas tanoshimi · Feb 21, 2019 at 10:01 AM 0
Share

That's actually a $$anonymous$$UCH better solution to the problem than the one that's marked as "best answer"

avatar image JulesVerny · Sep 29, 2017 at 08:17 AM 0
Share

Yep simple neat answer. Just move the mass of the body lower, to make it more difficult to topple over. Although does tend to make the vehicle oscillate rather (Weeble Wobble) But at least keeps the Vehicle keeps upright. $$anonymous$$ore and $$anonymous$$ore appropriate Physics to solve the issue. Applying axis Constraints is very artificial, and not really applying real physics, so could lead to more mess later on.

avatar image coreekymon · May 24, 2019 at 06:05 AM 0
Share

Wow thank you, I've been having so much trouble trying to make my car more stable. This is such a simple but effective solution, which is just my style :) I was trying so many things to like limit the rotation of the car, but nothing was working in a satisfactory way.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

RotateAround Limitations 2 Answers

Rotating sprite through touch (storing current rotation) 0 Answers

Sphere rotation in moving direction 1 Answer

2D sprite rotation with velocity and interpolation 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges