Forum rules - please read before posting.

Can an Animation Event trigger an Action List?

Hi!
I recently set up a little action list so my character would randomly switch to a blinking animation and then switch back.
I know i can apparently use the Sprites Unity Complex mode to do something similar, but looking at it gave me a headache and really, i want to keep things simple with this project.

Anyway, Here's my action list:

This works perfectly except for one thing. My characters idle animation is him doing a little bob, so when the random number triggers the idle animation swap, it sometimes happens at a weird time and the transition looks janky.
It's not a problem when switching back because the blinking idle animation only lasts 1 second, so i just used a timer.

My only thought was making an animation event on the last frame of the normal idle animation that would trigger the action list. Is this possible, or is there an easier way to do this? I tried looking into making my own Animation Events but i felt that headache coming back so i stopped.

Thanks!

Comments

  • edited August 2021

    ActionLists can be run manually by invoking their Interact function - you can trigger this via an Animation Event.

    AFAIK, an Animation Event can only trigger a function in a component that's present on the same GameObject as the Animator. If your ActionList is an asset file, attach a Cutscene component to your GameObject, set its "Actions Source" to "Asset File", and then assign the ActionList asset.

  • Thanks, Chris!
    This worked perfectly. I'm excited to implement this in other parts of my game too.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.