Go To

A CrowdBeGoto uses a NavMesh terrain in order to make an Entity (or a particle) compute a path and reach a target.

A Go To behavior in the behavior editor
 
This behavior needs to run at the same time as a Navigation Behavior to allow Entities navigating in the scene and being aware of obstacles and other entities. To do so use a Parallel Operator
 
Go To and Navigation in a Parallel Operator
 
To be able to use a Go To Behavior, the Terrain Locator associated to the Crowd Manager should use a navigation mesh.
 
Unlike the other behaviors, the Go To Behavior automatically stops when an Entity has reached its related target. If its stopping trigger triggers before, it will stop according to this trigger.
  • Behavior Editor / Behavior Library: 
  • Crowd Menu: Crowd Behaviors / Behaviors / CrowdBeGoto Node
  • MEL command: glmCrowdBeGotoCmd;

 

Configuration

A Go To Behavior defines the following specific attributes. To get more information about shared parameters, see here
 

Target Attributes

It is possible to define a target to reach for each entity. 4 modes and a reaching threshold are available:
 
Target attributes of a Go To Behavior
 
A target is considered valid if its projected position on the Terrain is inside the environment and not in an obstacle zone. A target is accessible if there is a valid path from the entity's initial position to the target projected position on the NavMesh. Figure below illustrates those differences:
 
Valid/Invalid, accessible/inaccessible targets
 

Random Target

If this mode is selected, each Entity will be assigned to a random valid & accessible target in the NavMesh. The targets can neither be viewed nor edited. This attribute is influenced by the random seed of the Crowd Manager
 
Random target mode
 

Target Locator

If this mode is selected, all Entities will be assigned to the GoTo Target  Locator selected in the "In Targets Locator" field. Here are the results of this mode:
 
Use targets from pool mode
 

Target Particle System

If this mode is selected, each Entity will be assigned to its corresponding particle in the target particle system selected in the "In Particle System" field (i.e. entity 1 will be assigned to particleTarget 1…). If the target particle system contains fewer particles than the navigating Entity, several navigating Entities could be assigned to the same target particle.
 
Example of a target particle system
 
It is also possible to specify the assignment of each Entity in the targeted particle system thanks to the field "Target Id PPName". If this field is set, each Entity will be assigned to the target whose id is stored in the float per-particle attribute stored in the "Target Id PPName" attribute of its relative particle. If this field is not set, of its value for one Entity is negative, the particleId will be used.

Per Particle Target Attribute

If this mode is selected, each Entity will be assigned to the position stored in the vector per-particle attribute stored in the "Target PPName" attribute. The Y value of this per-particle attribute will be projected on the terrain.
 
Definition of the per-particle attribute target
 
Target Reached Treshold When the distance to the target is smaller than this threshold, the target is considered as reached and the Go To Behavior stops. Notice that if the target is another entity, this distance should be greater than twice the Entity radius
Target is Dynamic  The Target Is Dynamic checkbox must be checked in order to take into account a moving target. When enabling this option, the Target Update Period becomes available. When using dynamic targets, the path of the crowd entity to the target must be recomputed.
Target Update Period This parameter defines the number of frames to wait before recomputing the path to the target (which means that during this time, the target's position won't change). Keep in mind that computing the path to the target is a heavy operation and using dynamic targets can decrease the performance of the crowd simulation, especially if the target update period is low. When using dynamic targets, it is possible to make two particle systems target each other (i.e. for battle scenes).