Jump to content
Aveyond Studios Community
Sign in to follow this  
Ant

Create or edit an animation event listener

Recommended Posts

What is an animation event listener?

An animation event listener lets an animation communicate with a hero block. With this listener, an animation event can execute an event on a hero block during the animation.

To use an animation event listener you must do two things:

  • Create the event listener on the prefab that contains the model.
  • Create an animation event on the modal that calls the event listener on the prefab.

Create an event listener on a prefab that contains a model:

Spoiler

In the Project Tab, navigate to the prefab that contains the animation with animation events. In the Inspector, click Add Component. In the search bar, type Hero Kit Listener Animation Event. In the results list, select Hero Kit Listener Animation Event to add it to the prefab.

tisgKec.gif

Create an animation event on the modal that calls the event listener on the prefab:

Spoiler

In the Project Tab, select the model that contains the animation. In the Inspector, click the Animations button. Select the animation clip that you want to assign an animation event. In the Events section, right-click on the timeline where you want to add an animation event and select Add Animation Event. In the Function field, enter CallHeroEvent. In the Int field, enter the ID of the event in the hero object that you want to play.

When you test your game and play the animation, it will call the event ID you specified in the active state on a hero block. 

In this example, we add an animation event to an animation clip called bat_attack. This animation clip exists inside a model called Bat Model. 

DRtD9sU.gif

Note: This is a little complicated, so we have a tutorial for this. You can find it here: Projects Tab > HeroKit Tutorial Scenes > Tutorial Scenes > Scene 3 – Animation Examples B.

 

Share this post


Link to post
Share on other sites
Sign in to follow this  

×