Effects
An effect is a small animated thing
Section titled “An effect is a small animated thing”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.
Placing one in a level
Section titled “Placing one in a level”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_createdon 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_doneon 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
Playing one from a script
Section titled “Playing one from a 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.
What you can change
Section titled “What you can change”- 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.
Where to go next
Section titled “Where to go next”Animation: how things move.