playMaker

Author Topic: Way to Manage Animations More Simply?  (Read 1067 times)

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Way to Manage Animations More Simply?
« on: November 22, 2018, 07:23:34 AM »
I have a character animator component that is set up on the player, and it has like 130 animations in its Animator graph with a web of links. Do I really need to set up 130 animator triggers, one for each transition, to send the character to that animation upon demand?

It would be best if there was some way to just do an action that said "Send Animator Transition"
then you specify the two string names of the animations that are being transitioned, which would never have duplicates in the graph.

So it would look like "
Send Animator Transition
Animation Name A (string): Standing Pointing
Animation Name B (string): Standing Thumbs Up
Send Event X if Transition Does Not Exist.
so it would find the transition called Standing Pointing > Standing Thumbs Up, and send it. Simple.

Is there a way to do this, or do i really need to add 130 (and more to come) animator triggers, and manually assign them to certain transitions, just to get this effect?

I also looked at the Play Animation action, but seems I need to add all 130 animations to a list for it to call from, which seems redundant since these animations are already in the character's Animator graph.

Unless I can populate this animation list by checking the character's Animator Graph at runtime, and unless I can copy this whole component onto other characters at runtime (or make them all draw from the same list), it makes things more convoluted than would be ideal.


The truly ideal way to do this, would be if there was an Animation variable in Playmaker, so I could make a Hash Table of Animations for all characters to draw from, then when I say "Play Animation" I specify the name of the animation, and it finds that key in the Animation hash table. The Play Animation/Animation list thing seems to do something similar, but do I have to add this list to every character model before runtime? Do I need to have an Animator component AND a list, all with all animations, transitions, and triggers, on every character, just so they all can do the same things? It seems there could be a more streamlined way.

So in conclusion,

A single hash table of animations that ALL characters could draw from with the use of a Play Animation/Get Animation Variable from Hash Table action,

and/or an action to populate a character's Animation List from its Animator graph at runtime,
and/or a Play Animator Transition by Name action in Playmaker, would make animation way easier.

Is there something I'm missing that makes this easy?

PS. It would also be cool if we could get a string array list of all the animation names in the Animation List (I'm making an in-game cut scene editor, and players need to know the exact name of the animations because some have underscores and some don't.)
« Last Edit: November 22, 2018, 07:29:57 AM by westingtyler »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Way to Manage Animations More Simply?
« Reply #1 on: November 22, 2018, 05:05:20 PM »
Hi.
I think you might want to try multiple conditions for the transitions and use Sub-State Machines

You can the use a trigger and go to a sub state machine and inside use (for example) an int to go to the desired animation in the sub state machine (group)