Skip to content

Effects

Sparks when a ball hits, smoke from a chimney, the burst when a teleport fires, a glowing trail: these are effects. The game ships hundreds of them, each an effect file, and it plays them where it’s told to.

An effect is shown by an entity with an effect component, which names the effect file to play. Its settings decide how it behaves:

  • play_on_created on plays it as soon as the level is up: a chimney’s smoke, a sign’s glow.
  • Turn that off and the effect waits to be told to play: a burst when something happens.
  • kill_on_done on removes a one-shot effect once it has finished. Leave it off for one-shots and the effect still counts as playing after it ends.
  • teleport_pad
    • triggertransformbox_triggerteleport_pad
    • burst_fxtransformeffectwaits to be told to play
    • idle_glowtransformeffectplays as soon as it's created
A pad with two effects: one always on, one fired by the pad's script.

A script tells an effect component to play, stop or kill. Placing the effect in the level and telling it to play, rather than creating it from scratch in the script, is the safe way. The effects cookbook shows how, and the traps.

Effects happen on each player’s own game. A script that plays one has to run on every machine, or only some players see it. See Server and client.

  • Which effect plays, where, and when: yes. Any shipped effect can be placed anywhere.
  • An effect’s colour: only if that effect was made with a colour setting. Many shipped effects have their colour built in, and asking them to change does nothing.
  • A brand-new effect: not yet. Effect files are made in a separate effects tool, and Studio can’t make or edit them.
For programmers

Effects are PopcornFX assets placed through the effect component, which takes play, stop and kill events and can set attributes the effect declares. Spawning an effect from a reference fished out of another component crashes the game; queue an event on a placed effect instead. Effects are client-side visuals.

Animation: how things move.