Skip to main content

Condition Nodes

Condition nodes add logic and branching to your animation flow — they evaluate conditions and control execution flow.

Overview​

  • Purpose: Create decision points where animation can take different paths based on conditions
  • Execution: Instant — evaluation is immediate, doesn't delay animation
  • Outputs: Single output port — execution continues if true, stops if false
  • Activation: Receives execution from triggers, animations, or other conditions

Common Characteristics:

  • Single output port — Condition node has one output port
  • Condition-based — Evaluates conditions (e.g., "If Player Enter", "If has tag")
  • Continue or stop — Execution continues if true, stops if false
  • Non-blocking — Evaluation is instant, doesn't delay animation

Common Condition Nodes​

NodeWhat It ChecksExample Use
Is Key PressedKeyboard key stateDifferent animations based on key input
Is Player In ZoneDistance/proximity checkAnimate when player approaches
Is Cursor HoveringMouse hover stateHover effects for UI or 3D objects
Is UI Button PressedButton click stateButton-specific animation logic
Is Variable EqualVariable equality checkConditional animations based on game state
Is Bool TrueBoolean value checkDifferent animations based on boolean state
Is ActiveGameObject active stateAnimate only if object is active
Has TagGameObject tag checkDifferent behavior for tagged objects

How Condition Nodes Work​

Execution Flow:

  1. Condition Node Evaluates: Checks a condition (e.g., "Is Key Pressed?", "Has Tag?", "If Player Enter")
  2. Evaluation Result: Returns true or false based on condition content
  3. Execution Flow: If true, execution continues to the next connected node; if false, execution stops
  4. Single Path: Only one execution path exists — continue if true, stop if false

Pattern:

Trigger → Condition Node (e.g., "If Player Enter")
↓
If true → Next Node
If false → Execution stops

Example Flow:

On Button Click → Is Variable Equal (Has Coin, true)
↓
If true → Fade In (Success UI) → Play Audio (Success Sound)
If false → Execution stops (no animation)

Execution Flow:

  • If Has Coin is true: Success UI fades in, success sound plays
  • If Has Coin is false: Execution stops, no animations play

Conditional Flow Types​

Flow TypeStructureUse Case
Simple ConditionCondition → Next Node (if true)Basic conditional logic
Chained ConditionsCondition A → Condition B → Condition CComplex logic chains
Conditional SequencesCondition → [If true → Animation → Condition]Multi-level conditional sequences

Best Practices​

  • Use for decision points — When animation should vary based on conditions
  • Keep conditions simple — Complex logic should be in code, not graphs
  • Test both paths — Verify execution continues when true, stops when false
  • Combine with other nodes — Use conditions with animations and actions for complex flows

Key Takeaways:

  • Condition nodes = logic — They evaluate conditions and control flow
  • Single output — Execution continues if true, stops if false
  • Non-blocking — Evaluation is instant, doesn't delay animation
  • Decision points — Create branching logic in your animations

Next: Delay Nodes