edited July 2022 in ORK Support
Hi,

I am finally getting around to trying out the changes made in May with regards to allowing us to swap animation controllers for Mecanim. First, I wanted to be sure that what I was doing was expected as I didn't really see anything saying this is how it should work.

Basically, I have my base / out of combat state which has the defined animations for various activities as triggers, and then movement is just an auto parameter.

image
image

Then in combat if you're using a sword/shield, we switch to a different animator controller (currently an override controller) which does not have any of these triggers defined, but instead just the auto parameter and swapping the controller:

image

This does work, where calling attack properly calls the attack trigger and fires off the appropriate sword animation even though none of that is defined at this level and only in the previous animator. I tried this with both animator overrides and a new animator controller entirely and it worked in both instances. This is what my above question was about, is this how it should work? Just wanted to verify this wasn't an "unintended feature" that might be fixed before taking advantage of it :)

My second question sort of ties into the above too. I know that in general, mecanim does not report animation durations back. While loading from the controller for initial setup, it switched to animation clip with the proper names. Does Mecanim provide accurate durations from these clips, or must I switch all of these to fixed duration with their specific times? It seems like it does, but the animations are generally so short it's kind of hard to notice if it is or not.

Lastly, combining the two, if I use the override setup above, how does it determine the duration? Since the clip names, whether an override or new controller, are different, how is it determining the duration time (if at all), is it pulling from the base or if not found, no duration? Would I want to manually define each animation type again per controller to ensure it gets the right duration or does using an animator override cause mecanim to properly parse what Unarmed_Attack -> SwordAndShield_Attack does?

Like I said, it all seems to work just fine but I wanted to double check if my "seems" is actually a reality or not before going forward too deep on that and end up doubling on work.
Post edited by Acissathar on
  • edited July 2022
    1) That sounds correct to me :)
    The combatant still uses all animations as set up for it - so, unless one of the animation setups also override those animation types, the stuff from your base animation setup will still be used.

    2) ORK gets the duration from the animation clip by finding it in the controller via the defined name (and also adjusts the time for the animator's speed, etc.). So yeah, should be accurate :)

    3) If your changed animator controller uses different animation clips (with different names), override the animation type with the new information in your animation setup.
    Otherwise it'll try to find it based on the original animation setup, not finding the animation clip so not being able to get a duration.

    Alternatively, change the animation clip names :)
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • @gamingislove Perfect, thank you! Being able to just define the specific animations in the controller and fall back on others without having to duplicate each time makes life much easier.
  • edited July 2022
    @gamingislove Might have encountered a bug with the auto parameter?

    When walking normally, the parameter is being set as expected:

    image

    When interacting with an interaction machine for dialogue, again, it's effectively 0 as expected:

    image

    However, when interacting with a shop or save point, for some reason the parameter turns into Not A Number, and this effectively breaks the movement animation:

    image

    Unfortunately, when this happens there are not any console messages either so not sure what it might be. Reloading / respawning the combatant fixes the issue as until you do the same interaction again as well.

    Edit: Did some testing, and it only happens with Freeze Pause. I suppose it has something to do with locking up animations, but for some reason it never gets fed the 'real' animation values once everything has resumed.
    Post edited by Acissathar on
  • Hm, yeah, seems like the combatant's move speed becomes NaN during freeze pause (i.e. timescale 0), I'll investigate and fix it in the next update.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Just wanted to add that this is a great post for others in the future @Acissathar
Sign In or Register to comment.