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 sadenly · Dec 09, 2016 at 05:08 PM · physicsrigidbodytransforminheritance

Disable transform inheritance for rigidbody

By default in Unity3d transforms that have attached rigidbody still inherit position and rotation changes from parent. Is there a way to somehow disable this behaviour, other than breaking the hierarchy?

Here is an example when this inheritance movement is unwanted:

I have a ragdoll on my character, and the character holds weapons in his hands, that have free moving parts. I have animation for the character, and thus for the main part of the character body isKinematic is turned on, but I want the weapons movement to be modelled. The inheritance deprives the poor weapon of its inertia, making it follow the hand. But breaking the inheritance will also cause me problems, as sometimes I want to manually set local transform for the weapon.

A bit lagging video example. The weapon sure behaves badly.

Pretty obvious workaround is making the "clones" of the weapon outside the hierarchy, and than copying their global coordinates on the actual weapon objects, but the situation seems rather standard and so it seems there might be a better solution to it.

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

1 Reply

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

Answer by Adam-Mechtley · Dec 09, 2016 at 06:48 PM

Hi @sadenly. A related topic actually just arose internally today. If you're wanting the handle the character is holding to be animated, and only the dangling part to be physical, you should be able to simply unparent the physical parts when the game starts. Physics are ultimately calculated in world space anyway, so your joint's definition at creation time (i.e. when the game starts) will not be affected by your transform topology.

Comment
Add comment · Show 5 · 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 sadenly · Dec 12, 2016 at 08:47 AM 0
Share

Hi @Adam-$$anonymous$$echtley! Thank you for your reply!

Well, the problem with breaking inheritance is that actually we have animations that contain information for (animate) the dangling weapon part, but we also have many animations that do not contain the weapon transforms, when playing later we want the dangling parts to be controlled by physics, when former - by us.

If we break inheritance, switching from animation "with animated weapon" to animation "without animated weapon" and vice versa will become more complicated, we will have to change each time from one hierarchy to another.

Do you think it will be more profitable than having "clones" or maybe there is some other way of handling this?

I am actually really interested, maybe there is some way to handle this in mecanim?

avatar image Adam-Mechtley sadenly · Dec 13, 2016 at 08:53 PM 0
Share

So what you need is a way to transition smoothly between animation control and physics control. Unfortunately this is a thing that is not (yet) possible with built-in tools.

Currently, what you need to do is have some non-rendered bit of the hierarchy that is controlled by animation and a separate physical hierarchy (usually flattened) that tracks the animated transforms (kinematically or actuated) with variable strength. I have an Asset Store package, Ragdoll Workshop, which has facilities for this (see this video or others here). There is also a similar product, Puppet $$anonymous$$aster, which I believe provides similar functionality, but I haven't used it personally.

avatar image sadenly Adam-Mechtley · Dec 14, 2016 at 08:30 AM 0
Share

Thanks, yeah, this is actually what I meant by clones - a system, that connects animated and physic controlled skeleton and merges their movement together. Only I thought about doing it the other way around - copying the physics-controlled animation onto the main, animation-controlled skeleton. Actually, I see the benefits of copying it the way you said, as it is necessary to copy from animation to physic controlled skeleton anyway, and you can save the resources of copying back from it.

Watched the video about the package - it looks really awesome! The fact, that it adds the ragdoll simulation as an animation is really intuitive and looks very easy to control.

I didn't quite understand thought if I can turn on physics only for the part of the skeleton and leave the other parts animated? Will it possible with the Ragdoll Workshop?

Show more comments
avatar image sadenly · Dec 14, 2016 at 10:59 AM 0
Share

Thanks for answering, I must have missed it in the video, everything seems clear now!

(For some reason I can't reply to your last comment, so I post as a comment to your original answer.)

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Throwing a ball around 2 Answers

How to properly move a rigidbody/collider? 2 Answers

C# always move an object forward and still use physics 1 Answer

Transform.Position vs Rigidbody.Position 1 Answer

how do i make this lag less? 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