Animation events

Using BBMOD_AnimationPlayer.on_event you can add functions that will be executed when an event occurs during the animation playback. The build-in animation events are:

You can also add custom animation events to a specific frame of an animation using method add_event.

animAttack = new BBMOD_Animation("Data/Character_Attack.bbanim");
animRun = new BBMOD_Animation("Data/Character_Run.bbanim");
animRun.add_event(0, "Footstep")
    .add_event(16, "Footstep");
animationPlayer.on_event(BBMOD_EV_ANIMATION_END, method(self, function (_animation) {
    if (_animation == animAttack)
    {
        // Do damage to surrounding enemies...
    }
})).on_event("Footstep", method(self, function () {
    // Play footstep sound...
}));
Do you find this page helpful?

Copyright © 2023, BlueBurn. Built on February 04, 2023 using GMDoc.