Get a reference to all Widget Animations from one Widget and storing them in an array (automatically) or/and from a parentWidget.

Here’s my setup:

  • I have several animations on WidgetX. (also buttons …etc)
  • All WidgetsX have a parent we’ll call it ParentWidget
  • I have 1 behavior tree to each WidgetX (hence the X in BehaviorTreeX)
  • there is only one WidgetX active at a time (they are pages, when u switch pages the old page is hidden)
  • MyPlayerController has a reference to ParentWidget from which I usually get all my references.

Desired Result:
I want to play a specific widget animation from BehaviorTreeX without having to do a lot of manual work and make it idiot proof. (I am currently adding by hand on WidgetX’s event graph each widget animation to an AN_arrayWidgetAnimations “aka. not ideal”) then getting a reference to that array from my player controller.

Here’s my issue:

  • I have tried to use the same logic I used for getting a reference to all the buttonsWidgets from ParentWidget; but with widget animations it won’t work the same. I cannot get all widgets animations and store them automatically into an AN_arrayWidgetAnimations.
  • Then, from the behavior tree get a reference to that AN_arrayWidgetAnimations and compare the display name of each animation to a string variable I have edited on my behavior tree.
  • Which would force me to copy and paste the display name into the string variable, but that is a result I’m okay with.

This system is FAR from ideal, there are many variable for error and at all not idiot proof. I’m trying to develop a tool to share with others, and this is just MEH design to say the least.
I wish I could simply:

  • Get reference to ParentWidget
  • Get all Widgets Animations
  • For each loop
  • Get display name + equal condition + branch (compare display name to string variable)
  • Play animation

Or even better: (inside the BehaviorTreeX)

  • Get reference to ParentWidget
  • all Widget Animations
  • get a dropdown menu of each animation available on WidgetX
  • Select the animation to play and call it a day!