Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
1
Question by Kr0e · Feb 10, 2012 at 09:33 PM · physicscollidertransforminertiarigid body

Rigidbody inertia recalculation after detaching child colliders ?

Hi,

if I have an object which is a rigid body and contains a sphere collider and has 2 children. The children are no rigid bodies but both contain a box collider. I hope this is a valid way to combine multiple colliders reffering to one rigid body.

Now I want to detach a child(the collider). My question is: Is it enough to simply call childObject.transform.parent = null ? Which kind of impact does this have on my rigid body ? Does it know about the change ? Or does it still think that there is collider.

I guess that the rigid body does not recalculate the inertia which is necessary after changing the collider set.

Soo... are there better solutions or are there methods like "recalcInertia" ?

Regards, Chris

Comment
Add comment · Show 2
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 Kr0e · Feb 11, 2012 at 09:53 AM 0
Share

$$anonymous$$aybe it works when I delete the rigid body component after detaching a child and then add a new rb component...

avatar image -brainer- · Sep 17, 2013 at 12:37 AM 0
Share
  • to this question, any results or evidence yet?

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by -brainer- · Sep 17, 2013 at 04:27 AM

I have now examined the effects of detaching a gameobject from its parents via debugging and retrospection. After the call to

gameobject.transform.parent = null;

the rigidbody of this gameobject will be reset automatically. First the mass to 1.0f, then other rather meaningful values for inertia and center of mass. Administrative values like constraints stay. So don't forget to finish your rigidbody setup after detaching from the parent. Another interesting behavior happens with its parent. Mass of rigidbody does not change. Although inertia and center of mass automatically do. In my setup I used objects with colliders or a hierarchy of colliders respectively. (Unity 4.2).

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
avatar image
0

Answer by sebas77 · Jan 31, 2014 at 03:12 PM

Unity3d does recompute all the rigidbody parameters on reparenting.

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

6 People are following this question.

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

Related Questions

Translate.transform problems (collision/Rigibody) 0 Answers

3rd Person Physics not working? 1 Answer

Ignore Collision Temporarily 1 Answer

How to properly move a rigidbody/collider? 2 Answers

ignorecollision return error 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