🧰
Developer
  • ENGAGE SDK overview
  • Setting up the ENGAGE SDK
    • Registering as an ENGAGE developer
    • Setting up your local git repository
    • Installing the Unity Editor
    • Opening the ENGAGE SDK Unity project
    • Checking for SDK updates
    • Installing a platform build module
  • ENGAGE SDK project folders
  • General guidelines for 3D models
    • Optimizing 3D models
  • Locations
    • Guidelines for locations
    • Creating a new location
    • Building a location bundle
    • Testing a location locally on Windows
    • Configuring an object as a teleport target
    • Configuring the start position
    • Seats
      • Creating a seat
      • Using the summon to seat system
    • Network states
      • Network State Manager
      • Location Network States
      • Example network state configurations
        • Network state toggle object
        • Network state animation start/stop
        • Network state change animation
          • Creating an animation in Unity
          • Using Animator.Play(string)
          • Defining Animator transitions
          • Using Animator.SetTrigger(string)
        • Network state sync animation
        • Network state position toggle
        • Network state automatic door
        • Network state toggle skybox
        • Network state change materials
    • Adding grabable objects to a location
      • Resetting network objects with a button
      • Resetting network objects when out of bounds
    • Locations reference information
      • Basic requirements for a location
  • Immersive Effects (IFX)
    • Guidelines for IFX
    • Creating an IFX
    • Building an IFX bundle
    • Testing IFX locally on Windows
    • Specialized IFX
      • Animated IFX
        • Animation overrides
          • Legacy animations
          • Animator animations
          • Configuring additional Effect Life Run Control properties
      • Audio IFX
      • Interactive IFX
  • List of available prefabs
  • Available scripts
    • External Video Player
  • Profiling
  • Publishing to ENGAGE
    • Publishing checklists
    • Pushing files to your GitHub repository
  • AFX
    • Getting started
      • Changelog
    • AFX Graphs
      • Creating an AFX graph
      • Editing an AFX graph
      • Navigation and keyboard shortcuts
      • Adding an AFX graph to a game object
      • Nodes
      • Ports
      • Connections
      • Flows
        • Starting a flow
        • Using multiple flows
        • Chaining flows
        • Controlling flows
      • References
      • Using AFX Events
    • Networking AFX
      • Network State Modules
      • Ownership of networked objects
    • Animation curves
    • Node dictionary
      • ENGAGE
        • AFX Companion
          • Constant Collision
          • Grab Object
          • PathData
        • Networking
          • Network State Modules
        • Physics
        • Player
        • Seat
      • Events
        • Collision
        • Unity
        • AFX Events
      • Flow
      • Reference
      • Unity
        • Component
          • Animation
            • Set Parameters
          • Audio
            • Audio Reverb Zone
            • Audio Source
          • Collider
          • FX
          • Rendering
            • Camera
            • Light
            • Material
          • UI
        • Constraint
        • GameObject
        • Input
        • Physics
          • Raycast
            • Layer Mask
          • RigidBody
            • Joint
              • Hinge
              • Spring
          • Wheel Collider
        • Time
        • Transform
          • Get
          • Set
          • Space Switching
      • Variable
        • Bool
        • Comparison
        • Float
        • Int
        • List
        • Math
          • MathF
        • String
        • Unity Component
        • Vector
          • Quaternion
          • Vector2
          • Vector 3
            • Vector3 Math
    • Sample graphs
Powered by GitBook
On this page
  • Flow And
  • Flow For
  • Flow For Each
  • Flow If
  • Flow Null Check
  • Flow Once
  • Flow Or
  • Flow Simple Timer
  • Flow Timer
  • Flow Toggle
  1. AFX
  2. Node dictionary

Flow

PreviousAFX EventsNextReference

Last updated 7 months ago

Flows control the execution of AFX graphs. For more information about flows, see Flows.

Flow And

Performs an AND logical comparison of Input 1 and Input 2, and continues the activating flow to one of two output ports depending on the result.

Inputs:

Name
Type
Description

Enter

Flow

Flow to activate the node.

Input 1

Boolean [editable]

First value to compare.

Input 2

Boolean [editable]

Second value to compare.

Outputs:

Name
Type
Description

If True

Flow

The activating flow continues out of this port if Input 1 and Input 2 are both True.

If False

Flow

The activating flow continues out of this port if either Input 1 or Input 2 are False.

Example

The following example activates a game object when two different colliders are both at designated locations.

Flow For

When activated, outputs a series of integer indexes. The full series of indexes are iterated through for each activation. The Body output port is activated once for each iteration.

The value of Index is guaranteed to be between Start and End only for nodes activated from the Body port. Nodes activated from the Exit port may have one additional increment of the Step value.

Inputs:

Name
Type
Description

Enter

Flow

Flow to activate the node.

Start

Int [editable]

Starting value for the index output. Must be zero or a positive integer.

End

Int [editable]

Value, that when exceeded, stops the iteration. Must be a positive integer.

Step

Int [editable]

Value to increment the index by in each iteration. Must be a positive integer.

Outputs:

Name
Type
Description

Exit

Flow

Continue the activating flow.

Body

Flow

Output flow that's activated for each iteration.

Index

Int

Index value that's output for each iteration.

Example:

The following example sets each item in a list of integers to the value 12 when the Start event is triggered.

Flow For Each

On activation, iterates through each item in the supplied list and send them sequentially to an output port. The Body output port is activated once for each item in the list.

Inputs:

Name
Type
Description

Enter

Flow

Flow to activate the node.

Input

List

List to iterate through.

Outputs:

Name
Type
Description

Exit

Flow

Continue the activating flow.

Body

Flow

Output flow that's activated for each item in the input list.

Item

Varies

Appears after you connect a list to the Input port, and then has a type that matches the list. Sequentially outputs the items in the list.

Example

The following example iterates over each integer in int_list and checks if any of the values are greater than 5. If one is, the greater_than_5 Boolean reference is set to True.

Flow If

Diverts the input flow to one of two outputs, depending on whether the Input is true or false.

Inputs:

Name
Type
Description

Enter

Flow

Flow to activate the node.

Input

Boolean [editable]

Value that determines whether the input flow is directed to the If True or If False outputs.

Outputs:

Name
Type
Description

If True

Flow

The input flow is directed to this output if Input is true.

If False

Flow

The input flow is directed to this output if Input is false.

Example

The following example plays one of two audio clips depending on whether the Y position of the moving_object reference is above or below zero.

Flow Null Check

Passes an activating flow to one of two outputs depending on whether the Input object is null.

Inputs:

Name
Type
Description

Enter

Flow

Flow to activate the node.

Input

Object

Object to be evaluated to determine if it's null.

Outputs:

Name
Type
Description

Is Null

Flow

Activated flow when the Input object is null.

Is Not Null

Flow

Activated flow when the Input object is not null.

Example

The following example rotates a game object if it's not null. You can assign the same game object to both reference properties in the Inspector panel. Unity will then cast the game object to the appropriate type.

Flow Once

Passes an activating flow to the Once output one time only. Any subsequent activations of the node are passed to the After output. The Has Run Once parameter records whether the node has been activated. You can send an activating flow to the Reset input to reset Has Run Once to false.

Inputs:

Name
Type
Description

Enter

Flow

Flow to activate the node.

Reset

Flow

Flow to reset Has Run Once to false.

Parameters:

Name
Type
Description

Has Run Once

Boolean [editable]

Flag that's set to true after the node is activated.

Outputs:

Name
Type
Description

Once

Flow

Output flow that's activated if there is an input flow and Has Run Once is false.

After

Flow

Output flow that's activated if there is an input flow and Has Run Once is true.

Example

The following example adds 1 to score_ref the first time that passed_finish is set to true. Any subsequent changes to the value of passed_finish are ignored.

Flow Or

Performs an OR logical comparison of Input 1 and Input 2, and continues the activating flow to one of two output ports depending on the result.

Inputs:

Name
Type
Description

Enter

Flow

Flow to activate the node.

Input 1

Boolean [editable]

First value to compare.

Input 2

Boolean [editable]

Second value to compare.

Outputs:

Name
Type
Description

If True

Flow

The activating flow continues out of this port if either Input 1 or Input 2 are True.

If False

Flow

The activating flow continues out of this port if both Input 1 and Input 2 are False.

Example:

The following example sets a game object to be active when either of two colliders reaches their designated points.

Flow Simple Timer

A timer that measures the time from its first activation to the value set by Duration. When the duration has elapsed, the activating flow is passed to the Completed output.

The timer node requires repeated activation, such as from an Update event, to measure the time passed.

Inputs:

Name
Type
Description

Enter

Flow

Flow to activate the node.

Loop

Boolean [editable]

If true, the timer repeatedly measures the elapsed duration and passes a flow to the Completed output at the end of each cycle.

Duration

Float [editable]

The amount of time, in seconds, to measure between first activation and passing a flow to the Completed output.

Outputs:

Name
Type
Description

Started

Flow

The flow is passed to this output the first time the node is activated.

Tick

Flow

The flow is passed to this output for each activation of the node when the timer is running.

Completed

Flow

The flow is passed to this output when the amount of time defined by Duration has passed.

Elapsed

Float

The amount of time, in seconds, that has passed since the timer started. If Loop is set to true, Elapsed is the amount of time that has passed in the cycle.

Remaining

Float

The amount of time remaining, in seconds, until the Duration has passed. If Loop is set to true, Remaining is the amount of time remaining in the cycle.

Example

The following example starts a ten second timer, updates count_down_ref with the time remaining, and activates the fireworks game object when the timer reaches zero.

Flow Timer

A timer that measures the time from its first activation to the value set by Duration. When the duration has elapsed, the activating flow is passed to the Completed output.

This is a more advanced version of the Simple Timer node and includes additional options.

Inputs:

Name
Type
Description

Enter

Flow

Flow to activate the node.

Restart

Flow

If activated by a flow, the count of time elapsed is reset to zero.

Pause

Flow

If activate by a flow, the timer countdown is paused.

Resume

Flow

If activated by a flow, the timer countdown will continue if the timer was in a paused state.

Toggle

Flow

When activated by a flow, pauses the timer if it was running or resumes the timer if it was paused.

Loop

Boolean [editable]

If true, the timer repeatedly measures the elapsed duration and passes a flow to the Completed output at the end of each cycle.

Duration

Float [editable]

The amount of time, in seconds, to measure between first activation and passing a flow to the Completed output.

Unscaled time

Boolean [editable]

Outputs:

Name
Type
Description

Started

Flow

The flow is passed to this output the first time the node is activated.

Tick

Flow

The flow is passed to this output for each activation of the node when the timer is running.

Completed

Flow

The flow is passed to this output when the amount of time defined by Duration has passed.

Elapsed

Float

The amount of time, in seconds, that has passed since the timer started. If Loop is set to true, Elapsed is the amount of time that has passed in the cycle.

Remaining

Float

The amount of time remaining, in seconds, until the Duration has passed. If Loop is set to true, Remaining is the amount of time remaining in the cycle.

Example

The following example starts a 60 second timer, updates count_down_ref with the time remaining, and activates the fireworks game object when the timer reaches zero. It also pauses or resumes the timer based on the value of the the timer_toggle reference.

Flow Toggle

Provides advanced branching and flow control. You can use the Toggle node to turn a flow on and off, invert a flow, and identify when a flow changes state.

Inputs:

Name
Type
Description

Enter

Flow

Flow to activate the node.

Turn On

Flow

If activated by a flow, sets the node to an on state.

Turn Off

Flow

If activated by a flow, sets the node to an off state.

Toggle

Flow

If activated by a flow, toggles the node between an on and off state.

Outputs:

Name
Type
Description

On

Flow

If the node is set to an on state, the activating flow continues through this output.

Off

Flow

If the node is set to an off state, the activating flow continues through this output.

Turned On

Flow

The activating flow is passed to this output when the node transitions from an off state to an on state.

Turned Off

Flow

The activating flow is passed to this output when the node transitions from an on state to an off state.

Is On

Boolean

Outputs true is the node is in an on state and false if the node is in an off state.

Example

The following example toggles the rotation of a game object on and off each time that a collision is detected.

Provides a time that's unaffected by time scaling. For more information about time scaling, refer to the Unity documentation for .

Time.timeScale
And node
Example use of an And node to check for two conditions
For node
Example use of a For node to set values in a list
For Each node
Example use of For Each to compare each value in a list to a constant
If node
Example use of an If node to set
Null Check node
Example to rotate a game object if a reference is provided
Once node
Example to add to a score one time, when a Boolean reference is true
Or node
Example graph to enable a game object when either of two colliders reach their designated points
Simple Timer node
Example graph to update a countdown and activate a game object at zero
Timer node
Example to update a countdown and activate a game object, with options to pause and resume the countdown
Toggle node
Example graph to toggle a rotation on and off