Go To

A Go To Behavior (beGoto) finds a path to reach a target for an Entity.

To use a Go To Behavior, the Terrain Locator associated to the Crowd Manager must use a NavMesh.

A Go To behavior in the behavior editor

This behavior needs to run in parallel with a Navigation Behavior to allow Entities to avoid obstacles and other entities. See how to properly handle dual Behaviors here.

Unlike the other behaviors, the Go To Behavior automatically stops when an Entity reaches its target. If its Stop Trigger triggers before, it will stop according to this trigger.


  • Behavior Editor / Behavior Library: 
  • Golaem Menu: Crowd Behaviors / Behaviors / CrowdBeGoto Node
  • MEL command: glmCrowdBeGotoCmd;


A Go To Behavior defines the following specific attributes. For common attributes see Behavior Common Attributes.
The Go To Behavior relies on the Entity bounding cylinder, its Radius and Height parameters are set in the EntityType.

Target Attributes

Reach Mode

Two Reach Modes are available:

  • Reach: the Crowd Entities will reach their target based on the Target Mode and the Target Reach Threshold
  • Flee: the Crowd Entities will flee in the opposite direction of their target based on the Target Mode, the Target Reach Threshold and the Target Flee Threshold

Example of Reach Mode - Example of Flee Mode

Target Mode
It is possible to define a target to reach for each entity. The Target Mode attribute determines how targets are assigned:

Target modes 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 navigation mesh. Figure below illustrates those differences:

Valid/Invalid, accessible/inaccessible targets

Random Target in Environment

If this mode is selected, each Entity will be assigned to a random valid & accessible target on 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

Use Target Poptool

If this mode is selected, all entities will try to reach slots on the Crowd Target Locator selected in the "In Target Poptool" field. Here are the results of this mode:

Use Target Poptool

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 of particleId 1 will be assigned to the target of particleId 1…). If the target particle system contains fewer particles than the navigating Entity, the entity particleId will be moduled by the size of the target particle system (i.e. entity of particle 6 will be assigned to the target of particleId 1 if the target particle system has 5 particles...).
Note that Golaem Crowd Population Tool can be used to emit the target particle system.

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, or its value for one Entity is negative, the particleId will be used. See ppAttributes Handling.

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. See ppAttributes Handling.

Example of the per-particle attribute targets

Target Expression

If this mode is selected, each entity will have a target given by the expression in the In Target Expression attribute.

Follow Curve

If this mode is selected, each entity fill follow a curve among the ones that are mapped to the GoTo Behavior.

Follow Curve mode


Target Reach Threshold When the distance to the target is smaller than this threshold, the target is considered reached and the Go To Behavior stops. Note that if the target is another Entity, this distance should be greater than twice the Entity radius
Target Flee Threshold If the Reach Mode is set to "Flee", the target is considered reached and the Go To Behavior stops when the distance to the target is higher than this threshold.

In Vector Field Locator Paintable Vector Field locator which will influence the way the Entities will reach their target.
In Target Poptool See "Use Target Poptool" mode above.
Slot Assign Mode

Available in "Use Target Poptool" mode. This determines the way the population tool slots are assigned as goto targets

  • By Id: the population tool slots are assigned according to the entity id
  • Random: the population tool slots are assigned randomly. A random slot of the poptool will be chosen as target each time the behavior is restarted or if "Target is Dynamic" is checked.
  • MEL Command: the user can control how the slots are assigned through a MEL function specified by the "Slot Assign MEL" attribute. The MEL function uses the index of the entity. Here's a template for this function (equivalent to the "By Id" mode):
global proc int defaultSlotAssign(int $index)
    return $index;
Slot Assign MEL See "Slot Assign Mode" above
In Particle System See "Target Particle System" mode above.
Target Id PPName See "Target Particle System" mode above.
Target PPName See "Per Particle Target Attribute" mode above.
Follow Curves The curves to follow. 
Curve Assign Mode

If several curves are mapped to the GoTo behavior, this attribute determines the way an entity chooses a curve:

  • By Id: the curve is assigned according to the entity id
  • Random: the entity chooses a curve randomly
  • Closest: the entity chooses the closest curve (depending on the Curve Start Mode)
Curve Start Mode

This attribute determines the point on the curve from which the entity will start following the curve

  • Beggining: the entity will start to follow the cuve from its starting point
  • Closest Point: the entity will start to follow the cuve from the closest point on the curve
Curve Sampling Mode

This attribute determines how the curve is sampled. The GoTo behavior picks up a number of points on the curve that are used as waypoints to reach.

  • Automatic: only the edit points of the curve are taken into account
  • Uniform: a fixed number of points on the curve are taken into account at a regular interval. The number of points is defined by the Curve Sample Count parameter
Curve Sample Count The number of points to use on a curve in Uniform curve sampling mode.
Auto Path Lateral Offset When enabled, this computes the lateral offset to the path to follow autiomatically, according to the inital distance to the curve.
Target is Dynamic 

The Target Is Dynamic checkbox must be checked for a moving target. When enabling this option, the Target Update Period becomes available. When using dynamic targets, the path of the Entity to the target will be recomputed during the simulation.

When using dynamic targets, it is possible to make two particle systems target each other (i.e. for battle scenes).

Target Update Period This parameter defines the number of frames 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 that can decrease the performance of the crowd simulation, especially if the target update period is low. 

Path Following Attributes

Path Follower Update Period  The number of frames before updating the path local target. Lower values can decrease performance and are only needed in tight environments.
Path Lateral Offset

When following a path to the target, this parameter determines the offset of the entity to the path. A negative value means the entity will try to follow its path while keeping to the left of it by the amount of this parameter, a positive value means the entity will follow the path to the right, and 0 means the entity will stay on the path. The lateral offset is taken into account only if the Spread Ratio is greater than 0.

The offset can be set either randomly, between Path Lateral Offset Min and Path Lateral Offset Max, or according to a per particle attribute. It can also be computed automatically in Follow Curve mode.

Left: Follow curve with no lateral offset (spread ratio set to 0), right: follow curve with random lateral offset and spread ratio set to 

Spread Ratio The factor to which to take lateral offset into account. If left to 0, no lateral offset is applied.

Advanced Attributes

Allow Collision At Start Enable this to allow computing a path that starts in a non-navigable cell. It will help only if it can directly reach a navigable one. May help obtaining successful path plannings near the navigable area borders, when the radius of the entity overlap an obstacle.