Channel Operator Goto

In the first Channel Operator Tutorial, you learned how to use the Channel Operators to let entities gather in the scene. This tutorial will teach you how to use the Channel Operators to follow the target of a Go To Behavior.


An entity going to its Go To target by using Channel Operators

Starting from a simple scene already populated with no behavior, here are the steps that will be covered by this tutorial:

Basic startup

The starting point for this tutorial is a populated scene with entity(s), and a Terrain. Check the Quick Start Tutorial if needed.

1. Start by adding a Go To behavior with a target across the environment.

A Go To behavior in the behavior editor and the Go To target at the other side of the corridor
2. Now add a Locomotion Behavior. Add locomotion animations and configure its Control Mode in Direct Mode controlled by animation:


The added Locomotion behavior, configured in Direct Mode controlled by animation

If you run the simulation at this point, the entity should not be moving. There is no navigation behavior to reach the target, and nothing else is driving the locomotion, so the entity should just play the rest motion.

Starting to move when the Go To behavior is started

To start moving when the Go To behavior starts, the idea is to use the Channel Operator behavior to set a desired speed when the entity has a Go To target, and reset it when it's not the case. Here is how to do this:

1. Open the Behavior editor, and add a Channel Operator Behavior on the entity type

2. Select the Channel Operator Behavior and Add a New Output Channel

 

Next steps will explains how to build the following graph of channel operators:


Graph of channel operators that select a speed depending on the hasAGoToTarget property of the entity

 

3. Select the newly created output channel and configure the Output Channel to output the to Entity Desired Speed, and rename it "outputDesiredSpeed"

4. Select the "outputDesiredSpeed" node, and add a previous ChOpMultiplexer

This stage will select the desired speed when the entity has a goto target, or a zero speed when it has no target.
Configure the Multiplexer Mode to Select Maximum and rename it "speedSelection"

5. When the "speedSelection" node was created, it should have create a ChOpInput connected to the first PreviousChOps plug (if not, then create one)

This input node will be the zero speed. Configure the Expression to "0" and rename it "nullSpeed".

4. Select the "speedSelection" node again, and add a previous ChOpInput

This input node will be the default navigation speed. Configure the Expression to "1.1" (or any other value depending on the scale of your entities) and rename it "defaultSpeed".

4. Select the "speedSelection" node again, and add a previous ChOpInput

This input node will be the weight that will be used to choose the default speed. We need the default speed to be selected whenever the entity has a local target, so configure the Expression to "this.hasAGoToTarget" and rename it "hasAGoToTarget" (check out the Channel documentation for all avail