0 votes
asked in General Help by
I know you can drag an object that you'd like to interact with the character but I'd like it to pick up a variety of items that I look at in the world.

Is this possible? Thanks

1 Answer

+1 vote
answered by Expert (111k points)
selected by
 
Best answer

Hi paranoid,
thank you very much for your support request.

Animations are a collection of animation curves. Animation curves define how the position/rotation/scale of a Unity transform/bone should change over time. The name of the bone/transform and it's location in the "Hierarchy" is used to identify which animation curve needs to be assigned to which bone/transform.

So making dynamic changes like adding and removing items from the bone/transform hierarchy is a problem, as the animation will then have animation curves for bones/transforms that don't exist anymore etc. The child-of constraint in UMotion can thus only be used for objects that are already within the hierarchy of your character.

So you can't do any dynamic changes like this directly in an animation clip, but you can do so using scripting and animation events. When your Animator controller is playing a "pick up" animation, it should trigger an animation event (that you can place in UMotion) at the time where the item that is picked up should be parented to the characters hand. Then the script function of your animation event should use transform.SetParent() to make the picked up item a child of the characters hand/wrist bone. Please note that you also need to define the position/rotation offset the item should have to the hand/wrist bone using a script.

Further information:
UMotion - Animation Events
https://docs.unity3d.com/ScriptReference/Transform.SetParent.html

Please let me know if you have any further questions.

Best regards,
Peter

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

...