Answered

Animating Props Which are not Children

Carl 3 years ago updated by Peter - Soxware Developer 3 years ago 1

Hello, I'm loving this asset! Amazing work. 

I'm looking for options to animate a character interacting and prop, where the prop is situated in world space and isn't a child of the character. One example is a lever. Is this possible? 

I also wonder if it's possible to extract the animation of a child object of the character, created with Umotion. That way it could be applied to other objects in the scene.

Many thanks!

UMotion Version:
1.23
Unity Version:
2019

Answer

Answer
Answered

Hi Carl,

thank you very much for your nice words. That means a lot to me.

I'm looking for options to animate a character interacting and prop, where the prop is situated in world space and isn't a child of the character. One example is a lever. Is this possible?

Animation clips can only reference bones/transforms/object that are a child of the Animator component. The correct approach for your situation depends on what you are trying to create. If you want to create a cut-scene, you can use Unity Timeline to animate both the lever and the character. UMotion's "Sync" button can be used to preview both animations in sync (while editing one animation). For more information, please checkout the chapter "Unity Timeline Integration" in the UMotion manual.

If this is an in-game situation, where the player walks to the lever and then presses a button to actuate the lever, then the problem gets trickier. I would use a runtime IK solution to first blend the hand to the lever (then keep it parented to the lever). Next play an "actuate" animation on the lever, this is automatically moves the hand with it as it is parented to it. Then after the animation was finished, blend the hand back to it's regular animation state. Using a regular animation clip instead of runtime scripting/runtime IK would require that your character is at the exact same position/orientation relative to the lever in-game as it was while authoring the animation.


Please let me know in case you have any follow-up questions.


Best regards,

Peter

GOOD, I'M SATISFIED

Thanks so much! I didn't realize there was Timeline integration, that's a huge help.

Satisfaction mark by Carl 3 years ago
Answer
Answered

Hi Carl,

thank you very much for your nice words. That means a lot to me.

I'm looking for options to animate a character interacting and prop, where the prop is situated in world space and isn't a child of the character. One example is a lever. Is this possible?

Animation clips can only reference bones/transforms/object that are a child of the Animator component. The correct approach for your situation depends on what you are trying to create. If you want to create a cut-scene, you can use Unity Timeline to animate both the lever and the character. UMotion's "Sync" button can be used to preview both animations in sync (while editing one animation). For more information, please checkout the chapter "Unity Timeline Integration" in the UMotion manual.

If this is an in-game situation, where the player walks to the lever and then presses a button to actuate the lever, then the problem gets trickier. I would use a runtime IK solution to first blend the hand to the lever (then keep it parented to the lever). Next play an "actuate" animation on the lever, this is automatically moves the hand with it as it is parented to it. Then after the animation was finished, blend the hand back to it's regular animation state. Using a regular animation clip instead of runtime scripting/runtime IK would require that your character is at the exact same position/orientation relative to the lever in-game as it was while authoring the animation.


Please let me know in case you have any follow-up questions.


Best regards,

Peter