Skip to main content

Events

An event is one sentence: when this happens, do these things.

WHEN  someone taps the door
THEN play the creak sound
swing it open over 600 ms
disable the "locked" sign

The when is a trigger. The then is a list of steps. That is the whole idea — and it covers a surprising amount of what a project needs.

An object can hold as many events as you like, and each one runs independently.

These are the names you see in the editor

If you also write scripts or build patches, each one has a short code name too — the trigger and step references list both side by side. Building in the editor, you never need it.

Two generated lists to keep open

Every trigger you can react to: triggers. Every action you can take: steps. Both come straight from the engine, so they are never out of date.

Every trigger, and what it is for

The generated trigger reference has each one's parameters. This is what they mean, and where they surprise people.

Input

In the editorFires when
Mouse buttona tap or click — branches for click, press and release
Hoverthe cursor enters or leaves the object
Double clicktwo clicks on the same object within 300 ms
Long pressheld for 450 ms without moving
Keya key — branches for press and release
Scrollthe wheel turns; filterable by direction
Dragplaced AR content is dragged
Pinchplaced AR content is pinched to scale
Rotateplaced AR content is twisted

The three gesture triggers only exist on surface scenes — they are about content the visitor placed. They repeat continuously while the finger moves, so treat them as a stream rather than a single moment.

Lifecycle

In the editorFires when
Launchthe scene starts — reaches every object
Resizethe window or viewport changes size
Pausethe app or tab goes to the background
Resumeit comes back
on-pause is where you stop things politely

Sounds keep playing when a visitor switches apps unless you stop them. Pausing audio and timers on on-pause and restoring them on on-resume is a small touch people notice.

Tracking

In the editorFires when
Detectthe marker or surface is found
Tracking losttracking is lost
Placedthe visitor placed the content
VPS readypositioning started up
VPS localizedthe visitor's real position was found
VPS localization failedit was not — this is normal, not an error
VPS errorpositioning could not run at all

Each is offered only on scenes whose anchor could produce it. Detection is reported on the edge, when tracking starts, not every frame.

A missed VPS localisation is expected

on-vps-not-localized fires routinely while the visitor walks around looking for a spot the map recognises. Treat it as "keep trying", not as a failure to announce.

Time and proximity

In the editorFires when
Delayonce, after a delay
Every N secondsrepeatedly — a repeat count of 0 means forever
Distancesomething comes within a distance, or leaves — two branches
Visibilitythe object is shown or hidden
Variable changea variable's value changes

on-distance has a "check at start" option. Without it, an object that is already close when the scene opens will not fire until something moves.

State, physics and interface

In the editorFires when
State activethis object enters the state you picked
State inactiveit leaves that state
Collisionthis object touches another — optionally only specific ones
UI actiona button on an interface card was pressed
Signalanother event emitted a signal
Game controlsthe character changed state

One event, both directions

Some triggers have branches, so a single event handles every outcome. Set a distance once, and answer both approaching and leaving:

TriggerBranches
Distanceentered · left
Keypressed · released
Hoverentered · left
Mouseclick · pressed · released
Visibilityshown · hidden
Game controlidle · moving · jumping · running

You get one section per branch in the editor. Triggers without branches have a single section, "on activation".

Which objects a step affects

Every step has targets.

Leave them empty and the step acts on the object holding the event — the usual case. Fill them in and it acts on those objects instead, which is how one event on a button opens three doors.

Taps travel up to parents

A tap, a hover or a card action reaches the object and its parents.

This saves a lot of repetition: put one event on a group and it catches taps on anything inside it, instead of copying the same event onto forty objects.

Two pleasant side effects:

  • "tap anywhere in this panel" is one event on the panel;
  • sliding between two children of the same parent does not fire hover/blur on the parent, because you never actually left it.

Collisions are the exception — they fire only where they happened. And keyboard, scroll, resize and scene-start are not about any single object, so they reach everything.

Several keys for one event

Jump on Space or W is one event, not two copies. The first combination lives in the trigger; the rest go in an "or" list, written as text:

ArrowUp        ctrl+KeyW        KeyA+KeyS        Space+double

Modifiers belong to the combination they are written in, and an alternative replaces the binding rather than adding to it. Mouse buttons use the same format (mouse:middle).

Better still: name a project binding instead of a key. Rebind "jump" once in project settings and every event that mentions it moves with it — which is what you want the day someone asks for left-handed controls.

Every step, and what it does

Parameters are in the generated step reference.

In the editorDoes
Scene transitiongo to another scene
Space transitiongo to another space, optionally to a specific scene
Open URLopen a link, in this tab or a new one
Open messengerFacebook, VK, OK, Instagram, Telegram, WhatsApp or Viber
Call phone numberstart a phone call
Compose emailstart an email
File downloaddownload a file from your project
Contact downloadoffer a contact card, built from the fields you fill in

The messenger step takes a page id for Facebook, VK and OK, a username for Instagram and Telegram, and a phone number for WhatsApp and Viber.

Changing the scene

In the editorDoes
Show / hide objectshow or hide the targets — on a scene this activates it
Set stateswitch into a named state, optionally easing over a duration
Override propertiesapply a one-off set of values as a temporary state

Animation

In the editorDoes
Play animationplay a timeline preset — loop mode, repeats, speed, delay
Stop animationstop one
Transformationmove, rotate or scale over time
Opacityfade
Materialblend the targets' materials toward a saved one
Bone transformmove a single bone
Built-in animationplay a clip that came with a model

Play animation can start an animation belonging to any object, not just the one holding the event — which is how one button starts a sequence involving several things at once.

Movement

In the editorDoes
Follow objectfollow continuously — distance, offset, smoothing and speed
Look at objectturn to face something without moving
Stop followingstop both
Fly along pathtravel along a path
Stop path flightstop that

Logic

In the editorDoes
If — otherwisecheck a condition, then run one of two nested step lists
Set variableset, add to, or toggle a variable
Send signalfire a signal — to the targets, or to everyone
Wait, thenpause before running the steps nested inside

Pointer

Lock pointer and Release pointer hide the mouse cursor and hand its movement to your scene — what a first-person game needs so the pointer does not wander off the window.

Conditions

if_action is a step, not a property of the event — so conditions nest, and "if inside if" is how you get more than two outcomes.

What the condition looks at is set by its source:

SourceChecksUsing
alwaysnothing — always true
variablea variable's valuevariable, operator, value
distancehow far the event's object is from anothertarget, operator, threshold
statewhich state another object is intarget, state
visiblewhether something is visibletarget, flag
randomchancethreshold, as a percentage

Values are read loosely: 3 becomes a number, true becomes a boolean, anything else stays text. == and != compare exactly; the other operators compare as numbers.

Variables, signals and timers

Variables last for the visit, not for the project — they start empty each time someone opens your experience. Give them their starting values from an event on scene launch. They are the same variables a script sees as globals.

Signals (emit_signalon-signal) chain events without copying steps: several events listen for level-complete, and anything can emit it. A signal that re-emits itself stops after eight rounds rather than freezing the frame.

Timers start when their object becomes live and reset when it is disabled. Re-enabling restarts the count instead of firing a burst of missed ticks.

States

A state is a named snapshot of an object's settings: position, colour, visibility, whatever you like. Switching to a state applies the snapshot, and switching with a duration makes it ease smoothly.

States are the tidy way to build a switch, a highlight, a door that is open or closed — without animating anything by hand.

While a state is selected, your edits go into it

Change an object while one of its states is active and you are editing that state's snapshot, not the object. This is exactly what you want when building states, and thoroughly confusing when you did not realise a state was selected.

Re-tracking

For AR scenes, each event's re-tracking mode decides what happens when the marker is lost and found again: start over immediately, never restart, or restart once the current steps have finished.

If you also write scripts

Events, patches and scripts all share one vocabulary — the same tap reaches all three.

Handle each trigger in one place only

The same trigger on the same object, wired as both an event and a script, runs twice. If something fires double, this is almost always why.


Next: Animation — making things move.