Logic Entity Save Support GetValue

LogicArithmetic

Performs arithmetic on two float values and fires an output with the result as a pass variable.

Inputs

Name Parameter Description
SetA Float Sets the first operand.
SetB Float Sets the second operand.
Add Computes A + B and fires OnValueComputed.
Subtract Computes A - B and fires OnValueComputed.
Multiply Computes A * B and fires OnValueComputed.
Divide Computes A / B and fires OnValueComputed. Dividing by zero will produce infinity or NaN.

Outputs

Name Pass Variables Description
OnValueComputed !value_c !value_a !value_b Fires after any arithmetic operation with the result and both operands as pass variables.

Pass variable details:

!value_c The result of the operation.
!value_a The value of operand A at the time of the operation.
!value_b The value of operand B at the time of the operation.

Exposed Values

These values can be read at runtime via the universal GetValue input, with a parameter of the value you wish to read. Using the prefix !, you can type the variable name into an input's parameter field, and the token will be replaced by the value of the variable.

Name Type Description
previous_result Float The result of the last arithmetic operation. Only valid after at least one operation has been performed.

Universal Inputs

These inputs are available on every entity in the engine, not just this one.

Name Parameter Description
GetValue String Reads the named exposed value from this entity and injects it into the pass variable pool. See Advanced Outputs for details.
AddVelocity x,y,z Adds the given vector to the entity's current velocity.
SetVelocity x,y,z Sets the entity's velocity to the given vector, discarding any current velocity.
SetPosition x,y,z Teleports the entity to the given world position.
SetScale x,y,z Sets the entity's scale.
SetRotation x,y,z Sets the entity's rotation from Euler angles in degrees.
AddImpulse x,y,z Applies an instantaneous physics impulse to the entity.
Destroy Despawns this entity on the next frame.

Notes

Because it fires !value_c as a pass variable, the result can be fed directly into any downstream entity that accepts a float parameter, eg. LogicCompare’s SetValue or another LogicArithmetic’s SetA.

Both operand values are saved and restored across saves, so an arithmetic entity used as a running counter will remember its current state after a load.

A common use could be as a counter. Set B to 1 once at map start, then call Add every time an event happens. Each call increments the running total in A and fires !value_c with the new count. Route that into a LogicCompare to check if you’ve hit a target number.

Chains are possible by routing !value_c from one LogicArithmetic into SetA of another, then immediately calling an operation on the second. The result of the first feeds directly into the second with no intermediate storage needed. This lets you build multi-step calculations entirely in the editor.

Avoid dividing by zero. There is no guard against it and the result will be infinity or NaN, which will likely break any downstream LogicCompare silently.