Conditionals
v1.0
Conditionals let you decide when an Action will execute — based on blackboard values, GameObject state, components, or even custom interface methods. You can build complex logic chains directly in the custom window without writing additional scripts.
🎯 Overview
Each Conditional defines a rule that can evaluate to true or false during runtime. When you attach one or more conditionals to an Action, the system evaluates them before the Action executes.
You can combine multiple conditionals using AND and OR logic to create precise control flows.
Examples:
Run only if the target GameObject is active.
Run if the Rigidbody’s drag equals 0.
Run if a Blackboard key
HasKeyis true.Run if a component implementing
IHealablereturnsNeedsHealing()= true.
🧩 Adding Conditionals in the Custom Window
⚙️ Conditional Fields
Subject
Defines which object the conditional operates on. Generally this is set at edit time, but can be modified at runtime.
Source
Target (the Action’s target) or GameObject (explicit reference).
GameObject
Only shown if GameObject is selected.
If you'd like to modify the subject at runtime, you can specify a GameObject or the Target as the source.
🧠 Conditional Types
Blackboard Value
Checks a value from the Action’s Blackboard.
Blackboard Key
Key to read from the Blackboard.
Operator
Equals, NotEquals, GreaterThan, etc.
Expected
Value to compare against (type-sensitive).
Valid Operators:
Bool: Equals, NotEquals
Int/Float: Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual
String: Equals, NotEquals, Contains, NotContains
Component Property
Checks a field or property on a Component.
Component Reference / Script / Type Name
How the component is identified.
Member
Property or field to evaluate.
Operator
Comparison operator.
Expected
Value to compare against.
Component Exists
Checks whether a specific component exists on the Subject.
Component Reference / Type
Component type to search for.
Succeeds If
Exists or Does Not Exist.
Game Object Active
Checks whether the GameObject is active in the hierarchy.
Succeeds If Object
Is Active or Is Not Active.
Game Object Tag
Checks the GameObject’s Tag.
Operator
Equals, Not Equals
Tag
Tag to compare
Game Object Layer
Checks the GameObject’s Layer.
Operator
Equals, Not Equals
Layer
Layer to compare
Custom Predicate
Calls a custom bool-returning method from an interface you define. For more complex checks, use the Custom Value Check below.
Interface Type
The interface that defines the predicate method.
Method Name
Must be a parameterless bool method.
Only interfaces with a public bool method defined will be selectable in the interface selection window.
Example interface code:
In the Conditional, set Interface Type to IHealable and Method Name to NeedsHealing.
Custom Value Check
Calls IConditionalValue.GetConditionalValue(string) on a component and compares the returned value. This is useful for custom systems and classes not defined by standard value types.
Value Name
Name to pass into GetConditionalValue.
Operator
Comparison operator.
Expected
Value to compare.
🔗 Combining Conditionals
When multiple conditionals are present, use Conditional Join to control evaluation:
And → all must be true.
Or → any can be true.
🧪 Runtime Evaluation
All conditionals are evaluated before the Action executes:
Individual conditionals can be tested manually:
Last updated
Was this helpful?