🧰
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
  • Creating an AFX Event asset
  • Invoking an AFX Event
  • Responding to an invoked event in an AFX graph
  • Responding to an invoked event in an AFXEvent Component
  1. AFX
  2. AFX Graphs

Using AFX Events

PreviousReferencesNextNetworking AFX

Last updated 7 months ago

You can trigger an AFX event in a graph, which then causes any associated listeners to activate. This can include the the activation of flows in other graphs. To use AFX events, you require the following three components:

  • An AFX Event asset.

  • An AFX Invoke AFXEvent node in an AFX graph that will trigger the event.

  • Something to listen for the invoked event. You can use an On AFXEvent Invoked node or an AFXEvent Component. An invoked event can trigger multiple listeners.

Creating an AFX Event asset

  1. In the Project panel, right-click in a folder, and then select Create > AFX Event.

  2. Enter a name for the AFX asset.

Invoking an AFX Event

  1. Add an AFX Invoke AFXEvent node in an AFX graph.

  2. Choose one of the following options:

    • Drag the AFX event asset that you want to invoke onto the Afx Event field.

    • Select the circle icon in the Afx Event field to open the Object Picker window, and then select the AFX event asset that you want to invoke.

  1. Connect a flow to the Enter port of the AFX Event Invoke node. When the flow is activated, the event will be invoked.

Responding to an invoked event in an AFX graph

To respond to an invoked event in an AFX graph, use an On AFX Event Invoked node. When the event is invoked, the node will initiate a flow.

  1. Add an On AFXEvent Invoked node in the AFX graph where you want to respond to the event.

  2. Choose one of the following options:

    • Drag the AFX event asset to which you want to respond onto the Afx Event field.

    • Select the circle icon in the Afx Event field to open the Object Picker window, and then select the AFX event asset to which you want to respond.

  1. Connect the Exit port from the On AFX Event Invoked node to the nodes that you want to activate.

Responding to an invoked event in an AFXEvent Component

You can use an AFXEvent Component to trigger a list of function calls. To use an AFXEvent Component, complete the following steps:

  1. Optional: Create an empty game object.

  2. Add an AFXEvent Component component to your chosen game object.

  3. Choose one of the following options:

    • Drag the AFX event asset to which you want to respond onto the Afx Event field.

    • Select the circle icon in the Afx Event field to open the Object Picker window, and then select the AFX event asset to which you want to respond.

  1. In the On Event Triggered list, select the plus symbol. A row for a triggered event appears.

  2. Drag a game object that you want to modify in response to the event onto the object field.

  3. From the function list, select the function that you want to call in response to the event.

  4. Repeat from step 4 as needed.

Dragging an AFX event asset onto an AFX Invoke AFXEvent node
Dragging an AFX event asset onto an On AFXEvent Invoked node
Dragging an AFX event asset onto an On AFX Event component