Logic Events

Logic events add frame-based behaviour to an animation: move the character, play a sound, spawn a projectile, branch to another animation, toggle invincibility, change health. They are the way to build a custom move without writing Lua.

Adding an Event

Select a frame, open the Events section in the Inspector, and use the add button. A searchable list of event types appears — type to filter it, then pick one. The new event appears as a row you can expand to edit its settings, or delete.

Events are stored inside animation logic in logic.json.

The One Rule That Surprises People

If an animation defines any logic events, its default classic behaviour is switched off.

The events become the animation's behaviour. Movement, branching, spawning and everything else must now come from the events themselves or from Lua — the original controller will not contribute any of it. Only the default physics step still runs around your events, giving you gravity and world collisions.

This is deliberate: it stops original controller side effects from leaking into a custom move. But it means you cannot add one small event to an otherwise-classic animation and expect the classic behaviour to continue underneath. If you want classic behaviour, use a behaviour override and no events.

Event Timing

Events are placed in time in one of two ways:

  • Exact frame — the event fires only on the frame that matches. Most events work this way.
  • Frame window — the event is active between an after-frame and a before-frame. If both are 0, the event is active for the whole animation.

Frames are counted from the start of the selected sprite frame, so 0 is its first frame.

Events run before the animation's Lua script, so a script can react to what the events have already done on that frame.

Event Types

Names below are exactly as they appear in the editor's list.

Movement

Event Effect
Set Velocity Sets speed directly along each axis.
Set Acceleration Applies acceleration along each axis.
Input -> Velocity Translates held player input into velocity. Players only.
Input -> Acceleration Translates held player input into acceleration. Players only.
Set Pos Offset Shifts real position immediately, and marks the object as teleported.
Stop Stops the character.
AccX(0) -> Stop Stops when horizontal acceleration reaches zero.

Animation branching

Event Effect
Set Anim Switches to another animation.
Input Button -> Set Anim Switches when a button is pressed during the window. Players only.
Input Combo -> Set Anim Switches when an input chain matches. Players only.
Hit -> Set Anim Switches when this character's hit box connects. Players only.
Land -> Set Anim Switches on landing.
Land -> Set Frame Jumps to a frame of the current animation on landing.
AccX(0) -> Set Frame Jumps to a frame when horizontal acceleration reaches zero.

Spawning and state

Event Effect
Spawn Enemy Creates an enemy.
Spawn Item Creates an item, optionally as a projectile with its own damage and hit sound.
Grab Converts a connected hit into a grab.
Flip Flips the character's facing.
Destroy Removes the entity.
Set Invincibility Turns invincibility on or off.
Add Health Adds health; use a negative value for a cost.
Set Value Writes to a custom value slot, for Lua scripts to read.

Audio

Event Effect
Play Sound Plays a sound from a chosen mod on a chosen channel.
Play Music Plays a music track.

Axis Conventions

For every event with X, Y and Z components:

  • X is forward/backward — positive is forward, relative to the direction the character faces. You do not need separate events for facing left and right.
  • Y is up/down — positive is up in the editor. The engine stores it inverted internally, but you never have to think about that while editing.
  • Z is towards/away from the camera.

Movement events have a checkbox per axis. Unticking an axis means "leave the character's existing movement on this axis alone" — which is different from setting it to zero. This lets you kill horizontal speed while preserving a jump arc, for example.

Events or Lua?

Use events when the answer is fixed by frame number: play a sound at frame 6, launch at frame 0, spawn at frame 7, branch on landing, cancel on a button.

Use Lua when the answer depends on runtime state: how far away the target is, current health, whether a victim exists, weapon type, multi-hit cooldowns, enemy AI phase, custom recoil on hit.

They combine well, and the combination is usually the right answer for a complex move: events for the predictable timeline, Lua for the exceptional branches.

For worked examples with real JSON, see Logic Event Examples.

Related pages: The Inspector, Behaviour Modes, Audio Events, Player Logic, Enemy Logic, Item Logic.