0 votes
asked in General Help by

Hi!

First of all, thanks for a great tool, it's awesome.

I have this lantern which I would like to use in my FPS animation. I want the handle to have the "Child of" constraint, and the lantern to swing freely, using the hinge joint component in Unity.

Both parts needs to have RigidBody components and one of them needs to have a HingeJoint component.

Is this possible? Or is there a better way to achieve this?

1 Answer

0 votes
answered by Expert (111k points)
selected by
 
Best answer
Hi,
thanks for your support request and for your nice words.

The rigid body components are disabled while previewing your animation in UMotion but yes, I think this should be possible.

Some things to consider: The child-of constraint is not changing the parent-child hierarchy (when looking at the hierarchy in Unity's Hierarchy window). It only moves the object in such a way, that it looks as if it would be a child of a different parent. As you're lantern will be driven by physics anyway and you thus won't animate it by hand, you could just parent it to your characters hand during runtime using transform.SetParent().

Best regards,
Peter
commented by

Thank for the advice, that worked nicely!

For anyone else who's looking for a similar solution:

I put the object under the wrist transform and then added a script with transform.SetParent.


It still needs some tweaking. For instance, the Rigid Bodies can't follow the mouse movement since that script is updated many times per frames while the physics is updated once per frame. Maybe I'll add force once when I start moving a certain direction.

It looks like this right now if I trigger it manually:

Soxware Support

Here you get official product support by the developer and the community for all Soxware Products for Unity®.

Post as guest, login via Facebook or create an account.

Ask questions, report bugs or provide feedback. Please use the correct category and always post in english.

For private email support, please use the Support Form to create a support ticket.

Copyright © 2017 Soxware Interactive | All Rights Reserved | Impressum

...