Animation
Events, Audio, and Action Timing
Create event definitions, trigger them at exact frames, and bind audio to check action timing.
After this article
Create event keyframes with parameters and use audio to verify action timing.
Create an event definition
- 1
Add an event
Expand Events on the right, click Add, and enter a stable name such as footstep or attack_hit.
Expected resultThe event definition appears in the list and can be used by keys in multiple animations.
Use stable, meaningful event names that the game runtime can recognize. - 2
Fill in event parameters
Select the event and inspect its name, integer, float, and string values in the inspector. Follow the game's callback contract rather than ad-hoc meanings.
Expected resultThe event definition supplies the parameters the runtime expects.
Event parameters and audio binding are managed in the same inspector area.
Import and bind audio
- 1
Import an audio resource
In Skeleton mode, choose Import → Import Audio and select a common MP3, WAV, or OGG file. Wait for decoding and resource import to finish.
Expected resultThe audio appears in the Audio section. If decoding fails, use a supported file that the browser can decode.
- 2
Bind it to an event
Select the event and choose the resource in the audio-binding menu, or drag the audio into the designated area. Set volume and left–right balance.
Expected resultThe event shows the bound audio, which can be cleared later.
Bind audio to the event first, then trigger that event at a specific frame.
Trigger at an exact frame and verify
- 1
Locate the action frame
In Animation mode, select walk or attack, pause, and move to the exact foot-contact or hit frame.
- 2
Add the event key
Select the event and use Add Event Keyframe at Current Frame. Check whether the same event already exists there before adding another.
Expected resultThe event track has a marker at the current frame, while bone tracks remain unchanged.
An event must be attached to an animation and a frame; a definition alone does not play it. - 3
Start playback from a user gesture
Click Play or press Space so the browser can unlock audio. Check that sound and motion coincide and adjust the event frame as needed.
Expected resultAudio and action are synchronized, and browser autoplay restrictions are not mistaken for a failed binding.