One of the purposes of behaviors is to move delegates in a particular direction over the course of the simulation.
The following behaviors can be used to direct delegates:
- The Seek behavior is one of the most commonly used behaviors in the crowd system. With this behavior, you can cause delegates to move toward a specific object. The seek object can be animated, and the delegates will follow it.
- The Wall Seek behavior causes delegates to seek a rectangular area. Compare with the Seek behavior, which causes delegates to seek an object's pivot point.
- The Path Follow behavior is also useful for pushing delegates in a specified direction. With this behavior, delegates follow a path but can “stray” from the path by a specified distance, creating slightly random motion along the path.
- With the Surface Arrive behavior, delegates seek one or more objects as they do with the Seek behavior, but you can cause delegates to stop when they reach a target.
- You can use the Surface Follow behavior to cause delegates to move along a surface.
- With the Space Warp behavior, you can use a vector field to push delegates around the field to avoid obstacles. See Obstacle Avoidance.
After setting up a behavior, you must use Behavior Assignments to assign the behavior to a delegate or team.
Procedures
To use the Seek behavior:
- Select the Crowd helper and go to the Modify panel.
- In the Setup rollout Behaviors group, click New. Choose Seek Behavior.
The Seek Behavior rollout appears below the Setup rollout.
- On the Seek Behavior rollout, click None to add one seek object, or click (Multiple Selection) to designate more than one object for the delegates to seek.
- Change the default settings as desired.
To use the Wall Seek behavior:
- On the Create panel, click (Helpers), and click Grid. Create a grid in the scene.
Tip: For best results, do not use Mirror to copy a grid to be used with behaviors. Use Shift+Clone instead.
- Move and rotate the grid to position it.
Tip: The Wall Seek behavior attracts delegates to the grid in the direction of grid's local Z axis. With the grid still selected, use the Local coordinate system to see the direction of the Z axis in viewports; the axis arrow points in the direction of the positive Z axis. Checking the Z-axis direction will speed the process of setting up the behavior.
- Select the Crowd object, and add a Wall Seek behavior.
- In the Wall Seek Behavior rollout, click None, and pick the grid.
- Choose Positive Axis to cause the delegates to be attracted to the Z-axis side of the grid. You can also choose Negative Axis to atrract delegates to the opposite side of the grid, or Both to attract them to both sides.
- If you want delegates to be attracted to the grid only when they are within a specified area in front of the grid (rather than when they are anywhere in the scene), turn on Use Distance. Use the Inner Distance and Outer Distance parameters to set the area in which delegates will be attracted to the grid. Turn on Display Distance to see the distance in viewports.
To use the Path Follow behavior:
- On the Create panel, click (Shapes). Create a shape to be used as a path for delegates.
- Add a Path Follow behavior to the Crowd object.
- In the Path Follow Behavior rollout, click the None button and pick the shape for the delegates to follow.
- Set the Radius parameter to the number of units by which delegates can stray from the path. Change other settings as desired.
To use the Surface Arrive behavior:
- Add a Surface Arrive behavior to the Crowd object.
- Add an object or objects to serve as the target surface to the scene.
Note: If you use multiple objects, delegates will arrive at the surface of the closest object.
- In the Surface Arrive Behavior rollout, click None or (Multiple Selection) to designate the one or more target objects.
- Use the settings in the Location group to determine where the delegate will stop when it reaches a target object.
- Use the settings in the Approach group to determine how the delegate will behave when it approaches the target.
To use the Surface Follow behavior:
- Add a Surface Follow behavior to the Crowd object.
- Add an object or objects to serve as the follow surface to the scene.
Note: If you use multiple objects, they must intersect to form a contiguous surface. Each delegate will move to the closest surface, follow it to the next closest that it encounters, and then start following that one, and so on.
- In the Surface Follow Behavior rollout, click None or (Multiple Selection) to designate the object or objects whose surfaces the assignees are to follow.
- If you like, use the settings in the Projection Vector group to force delegates to move in a specific direction.