Answered

I need to move the IK handle via code

Peter - Soxware Developer 5 years ago updated 5 years ago 4

I need to move the IK handle via code to sync up final iK. I tried, GameObject.Find("Umotion_IK_Handle");

but runtime clears the "game object to animate".   How can I control the IK at runtime via code?

UMotion Version:
Unity Version:

Answer

Answer
Answered

Hi,
thank you very much for your support request.

The results of the IK algorithm are baked into the exported animation (like when you would be using IK in Blender, Maya,... and then export to Unity). You can of course use Final IK (or any other runtime IK solution) on top of the created animation. You can also use Final IK inside UMotion and then decide weather you want to bake the IK into the animation or execute the IK during runtime. You can use an empty GameObject (created outside of UMotion) as IK handle. For further information, check out the manual chapter "Pose Editor/Options" at headline "Extending UMotion".

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

Best regards,
Peter

Answer
Answered

Hi,
thank you very much for your support request.

The results of the IK algorithm are baked into the exported animation (like when you would be using IK in Blender, Maya,... and then export to Unity). You can of course use Final IK (or any other runtime IK solution) on top of the created animation. You can also use Final IK inside UMotion and then decide weather you want to bake the IK into the animation or execute the IK during runtime. You can use an empty GameObject (created outside of UMotion) as IK handle. For further information, check out the manual chapter "Pose Editor/Options" at headline "Extending UMotion".

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

Best regards,
Peter

I tried everything. there seems to be no way to get access to the ik handle via code. how do I make a handle I can control the transform

Transforms created in UMotion are only kept during edit time (they don't exist at runtime). If you want to access an IK handle at runtime, you need to create the IK handle outside of UMotion (using an empty GameObject). You can setup UMotion's IK to use that IK handle by applying the IK constraint to this IK handle.


Here is the IK video tutorial, it first explains the automatic setup using the IK Setup Wizard (that's not what you need) and then continues with the manual approach (that's what you are going to need):


But as mentioned above, UMotion's IK is not a runtime IK solution. The result is baked into the exported animation. That means that changes applied to the IK handle at runtime, won't have any affect unless you are using a runtime IK solution to calculate the IK at runtime (based on the IK handle). As mentioned in my previous post, you can also use Final IK directly inside UMotion.


Best regards,

Peter

Thank you, I'm making copies of four leg animal animations. I was making a script to speed up the process. I put one animal ontop of the other and made a script to move the feet rotation and position to match the umotion.   I do this in play mode (pause). every time I step forward I get a keyframe.