Skip to content

World Triggers & Logic

Make your world react — open a door when a player walks into a room, spawn something every few seconds, count how many players are here, greet people when they join — without writing any code. Drop a SSWorldTrigger (Add Component ▸ Social Scape/World Trigger) on any object and build a list of rules: when → (if) → do.

It uses the same logic as Interactables, so anything you learn here works there too. Between them, most worlds never need scripting at all.

How a rule works

Every rule (called a trigger entry) has three parts:

  1. Triggerwhen it runs (a timer ticks, a player enters a zone, someone joins…).
  2. Conditions (optional)only if these pass (a counter is above 3, a switch is on…).
  3. Actionswhat happens (play a sound, open a door, add 1 to a counter…).

Add as many entries as you like to one component. Add a Variable list at the top to remember values (a score, a state) between them.

Triggers (when)

Trigger Fires when… Where it runs
On start The world loads. Use it to set things up. Each player
On timer Every Interval seconds. Turn Repeat off for a one‑shot delay. Each player
On zone enter / On zone exit A player walks into / out of this object's trigger collider. The player who moved
On key down / On key up A bound key, mouse button, or controller control is pressed / released. Each player
On interact The player uses this object — aims at it and presses E / left‑click / VR trigger. The object becomes interactable and highlights on hover automatically (give it a Collider). Perfect for buttons, levers, or sitting in a Station. The player who used it
On player joined / On player left Someone joins or leaves the instance. The server, for everyone
On variable changed A World or Player variable's synced value changes (see Variables). Great for updating a shared/HUD display. Each player
On custom A custom signal with a matching Signal name is sent (by a Send custom signal or Random branch action). The chaining/sequencing primitive. Each player

Zones need a trigger collider

For On zone enter/exit, give the object a Collider with Is Trigger ticked (the runtime adds one if you forget). Make it as big as the room/area you want to detect.

Binding a key (On key down/up): the Input field is a standard Unity input binding. Click + and add a key (e.g. F), a mouse button, or a controller control. Add several and any of them fires it.

Logic: variables, conditions & operations

This is what makes it powerful enough to skip scripting. It's shared with Interactables.

Variables (remember things)

Add Variables at the top of the component — each has a name, a type (Bool, Int, Float, String), a scope, and a starting value. Use them as counters, scores, states (isOpen, score, wave).

Scope decides who shares the value:

Scope Meaning Use it for
Object Local to this object, on each player's machine separately. Not server‑known. A private cooldown, a local toggle.
World One shared value for the whole instance, kept on the server and synced to everyone. A team score, a global door state, a wave counter — anything all players must agree on.
Player One value per player, kept on the server and synced to that player. A personal score / lives / rank the server owns (can't be faked locally).

With a World variable, when any player's action changes it, the server applies the change and everyone sees the new value — and increments can't collide. Pair it with On variable changed to update a shared scoreboard the moment it changes.

A Player variable works the same way but is personal: each player has their own value (their own lives, coins, rank), owned by the server. When a player's own action changes it, only that player sees it update. An On player joined trigger can set a joining player's starting values (it acts for the player who joined).

All variables are session memory: they live while the world is running and reset when the instance restarts. (For permanent saves, use a NexusScript action that talks to your own database — see below.)

Names must be unique

Each variable in a component needs a unique name. If you declare the same name twice, only the first is ever used (the inspector warns you), and an empty name is ignored — so give every variable a distinct name.

Conditions (only if)

Each entry can have a list of Conditions — they all must pass for the actions to run. A condition reads a source and compares it. The available operators match the source's type:

  • Numbers (a variable or an Animator Int/Float): = > <
  • Booleans: Is true / Is false
  • Text (a String variable, or a Player source — see below): = Contains Does not contain Starts with Ends with In list Not in list (with an optional Ignore case)

Example: only open the vault if keysCollected ≥ 3.

Player source (allow‑lists / VIP): set the source to Player GUID to test who triggered it. The GUID is the same 32‑character id your account page on the website shows — so to build a VIP area, set In list and paste the GUIDs you want to allow. It's server‑verified (a player can't fake their id).

Actions & operations (do)

Each entry runs its Actions in order. Actions are either effects or operations:

Effects

Action Does
Animator trigger / bool Drives an Animator (open a door, wave a flag).
Play audio Plays an AudioSource or a one‑shot clip.
Toggle active Shows/hides GameObjects (lights, props).
Spawn Instantiates a prefab at a point with a forward impulse.
Destroy Removes GameObjects.
Tween (animate) Animate an object with no scriptingmove / rotate / scale / fade / colour / punch / shake — with an easing, loops, ping-pong, relative/from, and an optional on-complete signal. The no-code counterpart of the Tween component.
Exit Seat (local player) Stands the triggering player up from the station they're sitting in — the counterpart to a seat's Lock Exit.
Set text Writes a variable's value onto a text label — TextMeshPro or a UI Text. Use a Template like Score: {value} (where {value} is the variable), or plain text for a static label.
Teleport Moves the player who triggered this to a Destination transform (position + rotation). Great for portals, respawns, or bouncing someone out of an area. Use it with the client‑local triggers (zone / key / interact) — not On player joined/left, which have no single player to move.
Respawn Resets the player who triggered this to their respawn point / checkpoint. See Combat & Respawn.
Set Respawn Point Sets the triggering player's respawn point to a Destination transform (reuses the same Destination field as Teleport). All later respawns go there. See Combat & Respawn.
Set Height-Respawn Chooses what happens when the player falls below the world's respawn height — Off / Safe respawn / Death — via the action's Height Respawn Mode dropdown. See Combat & Respawn.
Send custom signal Raises a named signal — every On custom entry with that name fires (anywhere in the world). Chain steps into sequences/state machines. Put it in a Networked entry to reach all players.
Random branch Sends one of a list of signals at random. Local flavour (a slot machine, a random sound) — for an outcome everyone shares, use Operation → Random on a World variable instead.
Video control Play / Pause / Stop / Load / Seek / … a Video Player by its Video name (argument = URL for Load, seconds for Seek).
Event Calls anything you wire up with a UnityEvent.

Respawn actions act on the triggering player

Like Teleport, Respawn, Set Respawn Point, and Set Height-Respawn act only on the player who triggered the entry. Use them with the client‑local triggers (zone / key / interact) — not On player joined/left, which have no single player to act on.

Operations (the maths/state) — change a Variable or an Animator int/float/bool:

Operation Does
Set Set it to a value (or another variable).
Add / Subtract / Multiply / Divide Arithmetic by a value or variable.
Increment / Decrement +1 / −1.
Wrap +1, but loop back to Min when it passes Max (e.g. 0→1→…→9→0).
Clamp Keep it within MinMax.
Min / Max Take the smaller / larger of it and a value.
Toggle Flip a bool.
Random A random value between Min and Max.

The classic counter

To cycle an animator state 0→1→…→9→0: one entry, Operation → Wrap, target your Int variable (or an Animator Int param), Min 0 / Max 9. Mirror the variable onto an Animator param to drive visuals.

For a Bool variable the operations are just Set / Toggle; for a String variable, Set it to some text (or another string variable). A World String you Set is synced to everyone — pair it with Set text for a shared announcement or status line.

Delay (wait before an action)

Every action has an optional Delay (in seconds): the engine waits that long, then runs the action. Use it to sequence trigger → wait N s → effect with no scripting — for example, on On zone enter, an Animator trigger to open a door with a Delay of 2 runs two seconds after the player steps in. Leave it at 0 for an immediate action.

Networking — who sees it?

  • Client‑local triggers (On start, On timer, On zone, On key) run on each player's machine for themselves. Tick an entry's Networked box to relay it — then everyone sees that entry's actions (a zone that opens a door for the whole room).
  • Server triggers (On player joined / On player left) are evaluated on the server and broadcast to everyone automatically — there's no Networked box to tick.

You never manage any IDs — it's handled for you (see World Objects ▸ Networking is automatic).

Examples

A join announcer

SSWorldTrigger → entry On player joined → action Play audio (a chime) and/or Animator trigger (a welcome banner). Everyone sees it, because it's a server trigger.

A room that lights up when you enter

Put a big trigger collider around the room. Entry On zone enterToggle active the lights on (tick Networked so everyone sees them). A second entry On zone exit → toggle them off.

A pad you press to advance a display

On the pad, On key down bound to E (or use an Interactable button) → Operation → Wrap an Int slide 0…9, then an Animator action to show that slide.

A wave timer

Entry On timer, Interval 10, Repeat on → Operation → Increment wave, then Spawn your enemy prefab. Add a Condition wave < 5 to stop after five waves.

A shared scoreboard

Declare a World Int variable score. On a button/zone, Operation → Add 1 to score (the server keeps everyone in sync). On the scoreboard object, an entry On variable changed, Watch variable score → action Set text, Text object = your label, Show variable = score, Template = Score: {value}. Everyone sees the same total update live, the moment it changes.

A shared announcement

Declare a World String variable notice. Anywhere you want to post a message, Operation → Set notice to your text (e.g. on a button: "Round starting!"). On a sign, On variable changed, Watch variable noticeSet text showing notice. Every player sees the same message change at once.

Personal coins (per‑player)

Declare a Player Int variable coins. On a pickup, Operation → Add 1 to coins — only the player who grabbed it sees their own total go up (the server owns it). On their HUD, On variable changed watch coinsSet text Coins: {value}. On On player joined, set coins to a starting amount for the new player.

A sequence (chaining)

Custom signals let one thing trigger another, so you can build sequences without scripting. A lever's On useSend custom signal stage1. Elsewhere, On custom stage1 → open a gate + Send custom signal stage2 (after a short On timer, say). On custom stage2 → spawn the boss. Each step is decoupled — anything can listen for a signal, and a step can fire the next. To make the whole chain happen for everyone, tick Networked on the entry that sends the signal.

A random reward

On a chest, On useRandom branch with signals gold, gems, nothing. Then On custom gold → play a coin sound + add to a counter; On custom gems → … etc. (Random branch is per‑player; for a result everyone sees identically, roll an Operation → Random into a World variable and branch on it with conditions.)

A VIP‑only room

Put a trigger collider at the room's entrance. Entry On zone enterCondition: Source = Player GUID, Not in list, paste your VIPs' GUIDs → action Teleport back to a "Destination" outside the door. VIPs (whose GUID is in the list) fail the condition and walk straight in; everyone else is bounced. (Flip to In list + a door‑open action if you'd rather reward the VIPs than bounce others.)

Quick reference

Want Trigger Then
Set up on load On start actions
Do something every N seconds On timer actions (+ a condition to stop)
React to a room/area On zone enter/exit actions (tick Networked)
React to a key/button On key down/up bind the input → actions
React to players joining/leaving On player joined/left actions (auto‑broadcast)
Count / score / state (any) a Variable + an Operation, gated by Conditions

When you do need scripting

The no‑code engine covers triggers, conditions, variables and operations. For arbitrary maths/expressions, loops, data structures, or saving data permanently, use NexusScript — and you can mix them: every entry has an optional NexusScript method field, so a no‑code trigger can call into a script for the hard part (e.g. saving a score to your own database).

Scripts and no‑code share state too: a script can read and write the same World/Player variables via World.* / Player.* (so a script updates score and your no‑code Set text shows it). See NexusScript ▸ Storage ▸ Shared variables for scripts.

Next