Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 sinepuller · Apr 06, 2019 at 09:38 AM · rotationrigidbodycenterofmass

Rigidbodies rotate around local pivot point rather than center of mass

TLDR: childless objects, each with a rigidbody and a collider, float around and collide. Upon collision they rotate around local pivot points rather than their centers of mass.

I'm trying to work on a simple physics playground where you can drag objects around and stack them onto each other. Gravity is turned off per object so that the object would float in the air while being dragged around, and is turned back on when the object is dropped. The objects have their pivot point at the bottom for ease of placement. The objects do not have any children, each has either a box or a convex mesh collider, each has a Rigidbody componenent. On colliding each other the objects start rotating while floating in the air, which is what I want, but for some reason they rotate around their local axis pivot point rather than their center of mass. I thought it should be the other way around, am I mistaken?

I've checked things with DrawGizmos and seems that centers of mass are calculated properly, right in the center, halfway above the pivot (which is touching the bottom). Sure, I can move pivot points to the centers for each object, but maybe I'm doing something wrong with my RigidBodies? Reading other people's question about center of mass rotations reveals that for the others the problem is reversed: objects rotate around center of mass for them while they want rotations to happen around pivot or some other custom point. My Unity version is 2018.3.11f1 if that helps.

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
1

Answer by Bunny83 · Apr 07, 2019 at 11:58 AM

Well, it's hard to tell what is wrong in your case, but yes, rigidbodies under physics control rotate around their center of mass. Though keep in mind that the center of mass is based on the colliders, not on the mesh. You haven't said what kind of collider you use. Keep in mind that dynamic rigidbodies with mesh colliders can only use convex mesh colliders and they can only have 255 vertices. Convex mesh colliders may have a different shape than the actual mesh. Do you set the center of mass yourself? Or do you let Unity calculate it?

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 sinepuller · Apr 07, 2019 at 02:20 PM 0
Share

I did not know center of mass is based on collider rather than the mesh itself, thank you! The colliders I'm using in the scene are either convex mesh (same mesh as the object) or boxes. I've checked things with DrawGizmos and seems that centers of mass are calculated properly, in the center of the corresponding meshes right where I'd expect them to be, halfway above the pivot (which is touching the bottom). $$anonymous$$ust be some bug then or some convoluted project setting maybe. I'll try to investigate, though I already resaved my models with their pivots close to their visual centers and decided to move on.

avatar image
0

Answer by roger0 · May 21, 2021 at 05:50 PM

I just did a test and it does appear that adding force to a rigidbody will make it apply the force on its pivot point.

Comment
Add comment · 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

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.

Follow this Question

Answers Answers and Comments

164 People are following this question.

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

Related Questions

How can I rotate around with a Rigidbody while respecting physics? 0 Answers

centerOfMass and local coordinate origin 1 Answer

Rigidbody rotation around CenterOfMass 1 Answer

Rigidbody Inside Rigidbody 2 Answers

Rigidbody Rotation Problem 0 Answers


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