🧰
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
  • Adding a reference node to an AFX graph
  • Using the same reference in multiple nodes
  • Variable components
  1. AFX
  2. AFX Graphs

References

PreviousControlling flowsNextUsing AFX Events

Last updated 7 months ago

You can use a reference node to pass an object reference into a graph. For example, if you want to create an AFX graph that moves a cube in the scene, you can use a Transform Reference node to pass a reference to the cube into the AFX graph.

You can also use reference nodes to pass objects from a parent graph into a subgraph. For more information, see Adding inputs to an AFX subgraph.

Each reference node has a field in which you can enter a reference name. A corresponding property will then be added to the AFX Object Reference Manager component when you attach the graph to a game object. As shown in the following image:

Adding a reference node to an AFX graph

  1. Open the graph in which you want to add a reference node.

  2. Right-click on the graph canvas to open the node dictionary, and then select the reference node that you want to use. For information about the available nodes, see Reference.

  3. In the reference node, enter a name for the reference.

  4. Select the game object that the AFX graph is assigned to.

  5. In the Inspector panel, assign an appropriate object to the reference property that was added to the AFX Object Reference Manager component.

Using the same reference in multiple nodes

If you use the same reference name in different reference nodes, they will refer the same object. However, this applies only to reference nodes that are within the same graph.

For example, in the following image both transform reference nodes have the same reference name (cube_ref), and so refer to the same object. This can be useful in large graphs where the alternative would be long connections between nodes.

Variable components

Variable components provide important, complimentary functionality to reference nodes. You can add a variable component to a game object, and then use it as a reference in an AFX graph. The variable type of the component must match the variable type of the reference node.

Multiple AFX graphs can reference the same variable component. You can use this functionality to pass variable values between AFX graphs.

To add a variable component, complete the following steps:

  1. In the Hierarchy panel, select the game object to which you want to add a variable component.

  2. In the Inspector panel, select Add Component.

  3. In the search field, enter component.

  4. Select the variable component that you want to add.

A Transform Reference node connected to a Translate node
Example cube_ref transform field added to the AFX Object Reference Manager component
Two reference nodes that refer to the same object