Skip to content

Variable actions

7 actions in the Variable category. Each block mirrors how the action appears in the editor's sidebar.

Add To Value

Every Frame
Add To Value Variable
Target not set | Amount 1

Adds an amount to a variable or property, accumulating the result each time it runs.

Input Type Default Description
Target Variant - The variable or property to add to.
Amount Variant 1 The amount to add each time.

Phases StartEvery FramePhysicsEnd

Adjust Value

Every Frame
Adjust Value Variable
Target not set | Operator '+' | Amount 1 | Min 0 | Max 100

Changes a variable by an amount and keeps the result within Min and Max. This is the one-step way to spend, damage or heal without letting a value run past zero or a cap.

Input Type Default Description
Target Variant - The variable or property to change.
Operator String '+' How the amount changes the value.
Amount Variant 1 How much to change it by.
Min Variant 0 The lowest the result may reach.
Max Variant 100 The highest the result may reach.

Phases StartEvery FramePhysicsEnd

Approach

Every Frame
Approach Variable
Target not set | To 0.0 | Step 1.0 | → Reached | → Going

Moves a number toward a target value at a fixed speed, without overshooting.

Input Type Default Description
Target Variant - The variable or property to move.
To float 0.0 The value to move toward.
Step float 1.0 How fast to move, in units per second.
Branch Goes to
Reached Where to go on the frame the number lands on the target value.
Going Where to go while the number is still short of the target value.

Phases Every FramePhysics

Lerp Toward

Every Frame
Lerp Toward Variable
Target not set | To 0 | Weight 0.1

Smoothly eases a variable or property toward a target value each frame. It keeps getting closer without ever landing exactly, so use Is Near to tell that it arrived.

Input Type Default Description
Target Variant - The variable or property to ease.
To Variant 0 The value to ease toward.
Weight float 0.1 How much to move each call, from 0 to 1. Higher is faster.

Phases StartEvery FramePhysicsEnd

Set Value

Every Frame
Set Value Variable
Target not set | Value 0

Sets a variable or property to a value.

Input Type Default Description
Target Variant - The variable or property to write to.
Value Variant 0 The value to store.

Phases StartEvery FramePhysicsEnd

Spring To

Every Frame
Spring To Variable
Target not set | To 0.0 | Stiffness 150.0 | Damping 10.0

Eases a number toward a target like a spring, so it overshoots and settles instead of gliding in. Stiffness pulls harder and Damping bleeds off the bounce. It settles without landing exactly, so use Is Near to tell that it arrived.

Input Type Default Description
Target Variant - The number the spring moves and stores back into.
To Variant 0.0 The value the spring settles at.
Stiffness float 150.0 How hard the spring pulls toward To.
Damping float 10.0 How fast the bounce dies down.

Phases Every FramePhysics

Toggle Value

Every Frame
Toggle Value Variable
not set

Flips a boolean variable or property between true and false.

Input Type Default Description
Target Variant - The boolean variable or property to flip.

Phases StartEvery FramePhysicsEnd