Skip to content
Docs
Build it yourself

Variables

Numbers, text, teams and timers that rules read and change - for the game, for each player or for each object.

Variables are what your game remembers: a score, a team, a timer.

The Variables page: variables, enumerations and expressions as cards, with the elapsed timer selected in the Inspector.

Make one

  1. Open Variables and press New variable.

  2. Name it, and pick its Type and Scope.

ScopeOne value forRead it as
Gamethe whole gamescore
Each playerevery playerplayer.score
Each objectevery objectball.hits
  • Starts at: its first value.

  • Reset at match start: turn off for settings that should stay, like a score limit.

  • Timer: counts seconds by itself, while a condition holds or when rows start it.

Enumerations

A short list of named values, like teams (Red, Blue) or phases (kickoff, playing).

Expressions

A formula with a name, such as HasWinner, used anywhere a value fits.

You never type formulas. You build them from blocks:

The HasWinner formula as nested blocks: or, and, compare, max of RedScore and BlueScore.
BlockGives
ValueA number, text, colour, point, yes or no
ReadA variable, a player, a line, a property
Math, CompareTwo values joined: plus, is at least…
And / or, NotConditions combined
ChooseOne value when something holds, else another
Functionmax, distance and friends
CountHow many players, instances…

Each slot only offers blocks that fit it.

Nothing and angles

  • Nothing spreads. A block that reads something missing, such as a destroyed ball's speed, gives nothing. Maths, text and comparisons with nothing give nothing, so a visual bound to it isn't shown and a condition counts as false. or is true when either side is, and and false when either side is.

  • Otherwise gives a value in place of nothing: otherwise(Ball's speed, 0).

  • Is empty asks the question directly: winner = empty.

  • Angles are in degrees everywhere in Studio: rotations, arcs, and the sin, cos, atan2, angleOf and fromAngle functions.

Live values

While Play runs, select a variable to see its value right now.