edited August 2023 in ORK Support
Currently in my setup, the enemies are using the same equipment as the player. Each piece of equipment has its own animation override (e.g. 1 Handed Swords). However, I am playing around with using a NPC specific animation that has animation events on it for a parry system. I can change the animation on the enemy combatant but it gets overridden by the equipment. Is there a way to limit animation overrides conditionally? For example, the sword overrides players with "1 Hand Sword" animations but "Enemy 1 Hand Sword" animations if the combatant belongs to enemies faction?

Obviously, I can duplicate the equipment if needed but thought I would check to see if I am missing something before I do the work.

Thanks
Post edited by shortyyard on
  • No, if it's equipped they'll get overridden, no conditions involved there.

    Either make a separate variant or not use equipment at all, e.g. adding the sword prefab to the combatant's prefab instead of using equipment viewers. Naturally only if the enemy only uses that one sword/equipment and never switches to a different one.
    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!
  • @shortyyard

    Assuming you are using Mecanim:

    Something you could do if you want to keep the same animator controller and ORK definition, is to have both your normal and enemy sword animations in the animator with their conditions. Add a new bool parameter in Mecanim called "IsEnemy" (or whatever) and use that as an additional condition into the enemy sword animation. Then create a Schematic and set it to the Spawn or Init (not sure if would matter which one, although you might need Mecanim transitions out of the normal animation to your enemy one just in case it's in a state before this kicks in) and in that Schematic, set the new IsEnemy bool in your Mecanim animatior.

    Since ORK otherwise doesn't know about this bool, it should never be reset unless it's a new instance or by your hand, and it's a way to reuse the same animator without needing to duplicate ORK animations or equipment. Then animations where this flag doesn't matter (e.g. enemy and player will use the exact same animation), just don't include it as a transition condition.
  • Thanks Acissathar I will give that a try.

    One more question on animations with ORK. Really just for organization purposes, but is there a way to call animations by state names if they are inside a sub-state?
  • Yes, you should just need to include the states separated by a period. So for example if you have an "Unarmed" substate and you want to play the Run animation there, in ORK it would be set as: "Unarmed.Run"
  • edited September 2023
    It doesn't seem to register the animation clip that way. I built a test animation controller with a single sub state machine and one clip in that sub state machine, tried loading from controller in ORK editor but it didn't load anything. Added another animation clip just on the base layer not in a sub-state machine and ORK loaded that one correctly.

    Edit: I was using the wrong equipment :( so it wasn't actually trying to play the animation override I was testing. SubState.StateName works. Oh note for anyone else going down this rabbit hole, you wont be able to use the state name for animation clip duration anymore. Uncheck use state name and input just the animation clip name without any sub-state info for ORK duration to work correctly.

    Thanks!
    Post edited by shortyyard on
Sign In or Register to comment.