Answered

Syncing with animation resets position

Max Braun 3 years ago updated by Peter - Soxware Developer 3 years ago 12

Hello there!

I am trying to do the impossible, aka getting 2 humanoids to interact properly with each other - I tried to make them generic, but the custom IK setup crashes UMotion (already submitted a bug report), so I am stuck with using humanoid. Now, whiel tedious, thanks to the syncing feature, it should work out.

However, when the animation of the synced character (Zell, the white haired demon in the screenshot) is previewed in unity, it sets her position to 0,0,0, instead of keep her on the right of the blonde Tayla. I tried every perumtation of root motion curves and animation clip settings, but she still jumps away when syncing and previewing. 

Any ideas?

Image 819


UMotion Version:
1.24
Unity Version:
2019.4.2

Answer

Answer
Answered

Hi Max,

thanks for your support request.

As mentioned in my reply to your bug report, please update your UMotion version to the latest from the asset store. Not only does it most possibly solve the exception that you've experienced when using custom IK, it should also help with the timeline syncing.

Also make sure that your Unity timeline version is up-to-date (see Unity package manager).

Regarding the Unity timeline offset, there are several settings that affect how Unity timeline does offset your character. It depends on the exported animation clips root motion settings (i.e. if it uses the "Original" root motion authored in your animation clip or if it uses the "Center Of Mass" of your character). Then inside Unity timeline, it depends on the settings you have made for your animation track and the animation clip inside your track (e.g. the pos/rot offset values and if "remove start offset" is used or not).

Using "original" for all your root motion curves (of your exported animation clip) and disabling the "remove start offset" in the clip settings in Untiy Timeline might be a good starting point.


But when you want really precise interactions, I highly recommend using generic and animate both character's at the same time using a single "uber" animation clip. Despite being the simplest solution, it also comes with no quality trade-offs (as humanoid does).


Best regards,
Peter



Answer
Answered

Hi Max,

thanks for your support request.

As mentioned in my reply to your bug report, please update your UMotion version to the latest from the asset store. Not only does it most possibly solve the exception that you've experienced when using custom IK, it should also help with the timeline syncing.

Also make sure that your Unity timeline version is up-to-date (see Unity package manager).

Regarding the Unity timeline offset, there are several settings that affect how Unity timeline does offset your character. It depends on the exported animation clips root motion settings (i.e. if it uses the "Original" root motion authored in your animation clip or if it uses the "Center Of Mass" of your character). Then inside Unity timeline, it depends on the settings you have made for your animation track and the animation clip inside your track (e.g. the pos/rot offset values and if "remove start offset" is used or not).

Using "original" for all your root motion curves (of your exported animation clip) and disabling the "remove start offset" in the clip settings in Untiy Timeline might be a good starting point.


But when you want really precise interactions, I highly recommend using generic and animate both character's at the same time using a single "uber" animation clip. Despite being the simplest solution, it also comes with no quality trade-offs (as humanoid does).


Best regards,
Peter



Jep, since you kept insisting on that, I switched to fully generic by now - another quick question:

Is there any way to tell the IK wizard to set-up the fingers as in humanoid rigs? Aka that there is a nice toolbox in the sceneview where you can control all fingers at once with a few handles?

Unfortunately the muscle sliders toolbox in the scene view is based on humanoid only Unity API so this is not supported for "generic".


But in order to curl the finger bones nicely, there is another neat way that works with any rig:

  1. Shift Select the uppermost finger bone in the hierarchy (i.e. the "proximal" bone). Holding shift automatically selects all child bones too.
  2. When you now use the rotation tool, the rotation is equally distributed between all 3 selected finger bones making it curl nicely.

Please let me know in case you have any further questions.

Best regards,
Peter

Thanks Peter, well, that is a shame.

Would it be somehow feasible to implement a custom Editor extension for that?

Still thanks for the answer and the hint!

Unfortunately I currently do not plan to implement something similar to the muscle sliders in humanoid for generic as a generic rig can really be anything (it can be a biped character with fingers, but it can also be a rigid object like a gun etc. where such sliders wouldn't make any sense). Furthermore, the method I mentioned above is a really fast and flexible alternative (that I for myself usually prefer over the muscle sliders even when available, but that's up to personal preferences of course).

Best regards,
Peter

Heyho Peter,

thanks for allthe thorough answers!
I tried the finger curling with shift click, and while it does work better then I had hoped, it is still rather tedious, since the Unity Move/Rotation/Scale Widget usually gets in the way, with the finger bones getting in the way. Still much better then the weird offsets humanoid characters produce by their inbuilt lack of precision :D

I'll see if I can get deep enough in the UMotion Code to implement something quick on my own then :)

A few tips:

If the finger bones annoy you, you can adjust their display size and rendering style to your liking. Check out the display section in the pose editor and the options tab in the pose editor for altering the overall display size/style. If you want to adjust the styling of individual bones/transforms, you can do that in config mode in the properties tab.

There are also some display options available for the rotation gizmo via the rotation tool assistant window shown in the scene view.

Best regards,
Peter

Thank you as so often^^

Would it be feasible make a gameobject with a script that 'talks' to the fingers in Umotion to use a slider in the script to curl the fingers?

You could use the UMotion callback system but the issue is, that you can't show the inspector of your script while your object is locked by UMotion. So you would need another editor window that "injects" the values...

Furthermore, the math behind the finger curl isn't as easy and straight forward as you might think because the bones can have any initial orientations. In other words you need to find a generic way to figure out in which direction you have to rotate the finger bone to bend it.

In other words, this might not be worth the hassle. I recommend using the shift click + rotation tool way as described above.

Best regards,
Peter

Heyho, yeah, I dove into the code and tried a few things, but all ended uphorribly, if they worked at all.

The finger rotation could be done by making the user define an "open" position and a "closed" position as references - and then just interpolate between these 2. This would not be that much more work compared to setting the right values within UMotion, and it would at least fix that issue rather easily.

And I really try to like the shift-click + rotation, but I always stumble upon somethign which breaks the otherwise so smooth animation workflow. Either it's inspector gadgets getting in the way (if zoomed out) or I zoom in and zoom to far, then have to reposition the camera, which overshoots due to me being zoomed in so much, then finally getting all the fingers, realizing they are not properly aligned so I need to animate them all individually, which would be fine, if I wouldn't animate the whole thing and then realize that now the ring finger looks kinda off since it is set up a bit differently then the others, etc.

As I said, I have tried and failed to implement what I would like to have (I has more success at getting RayFire thingies not to explode whenever they touched the ground, since the author implemented my solution), so I can imagine how tiresome this would be for you as well, but I really think it would help greatly in getting more people to use the (superior) generic configuration, which would result in better games for all of us :D

Hi Max,

yes lerping between an opened and closed hand pose would be an easy solution but it comes with trade-offs. Basically it limits the hand poses to be either the pre-defined opened pose, closed pose or anything in between. Any other adjustments and fine-tuning on the finger poses would be overwritten as soon as the sliders would be used.

So unfortunately there is no easy way to fix this, I highly recommend using the generic rotation tool. Using it a few times should help you getting used to it and it comes with great flexibility. Btw. you can use the [F] key (shortcut for the "Focus Camera" button) to make the camera re-focus the currently selected bones.


Best regards,
Peter