Skip to main content

Agent Catalog

An agent is designed to represent a person, animal, or vehicle that can walk, ride, or drive through a scenario and react to the traffic around it. There are three main types of agents:

  1. Ego agent: the participant's own character or vehicle, the one they control. The scenario's Player Selector creates it when the scene starts, so you don't place it yourself.
  2. Road agent: another road user that moves on its own, along a route you give it.
  3. Idle agent: an agent who stays in one place. Idle agents make the scene feel lived in, and they can also play a part in your study, such as someone the participant interacts with or talks to, or someone who gazes or points to draw their attention. They have no movement or controller, so they're much more lightweight than road agents.

You can browse the agents provided by HRI-MobiSim below to learn more.

Keep the originals intact

To change an agent for your study, make a prefab variant of it and edit that instead. A variant stays linked to the original, and the original stays untouched for your next scenario.

Pedestrian​

Ego agent
Prefabs:
  • EgoAgent_Pedestiran_Josh
  • EgoAgent_Pedestiran_Kate

A person on foot.

Pedestrian preview

Choosing It​

Select your scenario's Player Selector, and pick the pedestrian in Controllable Prefab. See Choosing a Controllable.

Tuning Its Movement​

It moves with the Player Pedestrian Driver on the root of its prefab.

Two of its settings are curves. On each curve, the X-axis is the participant's input, and the Y-axis is the speed that input gives. Input runs from −1 to 1:

  • −1 is full input one way, such as holding the back key or pushing the stick fully back.
  • 0 is no input.
  • 0.5 is the stick pushed halfway.
  • 1 is full input the other way, such as holding the forward key or pushing the stick fully forward.
Property
Description
Animator
The Animator that plays the character's animations. The driver sets its forwardAmount parameter to match the current speed.
Animation Blend Speed
How quickly the animation catches up when the speed changes. Higher values give quicker changes. Default 9.
Forward Movement Speed Curve
How fast the pedestrian moves forward or backward for a given input. X is the forward/back input, from −1 to 1. Y is the speed in meters per second (m/s). A negative speed moves the pedestrian backward. For example:
  • A point at x = 1, y = 1 means fully pressing forward moves the pedestrian forward at 1 m/s.
  • A point at x = −1, y = −0.5 means fully pressing back moves it backward at 0.5 m/s.
Walk Mode Input Clamp
Caps the input while walk mode is on, which lowers the pedestrian's top speed. Walk mode is on while the participant holds the walk key (Left Shift on the keyboard). Any input beyond the value is cut down to the value. Default 0.5. For example, with 0.5:
  • An input of 1 or 0.8 becomes 0.5, and −1 becomes −0.5.
  • An input of −0.2 stays at −0.2, because it's already within the limit.
So holding the walk key never lets the pedestrian go faster than a walk, whatever the input device.
Allow Turn In Place
Lets the pedestrian turn on the spot. When unticked, the pedestrian has to be moving forward or backward to turn.
Rotation Speed Curve
How quickly the pedestrian turns. X is the left/right input, from −1 (full left) to 1 (full right). Y is the turning speed in degrees per second (°/s). Positive values turn right, and negative values turn left. For example:
  • A point at x = 1, y = 90 means holding the right key, or pushing the stick fully right, turns the pedestrian right at 90° per second.
  • A point at x = −1, y = −90 turns it left at the same rate.
The same curve is used in first-person and third-person view.

The pedestrian only steps backward when it's facing roughly the same way as the camera. If it isn't, pressing back moves it forward instead, at the matching speed. The driver uses the scene's main camera for this check, so make sure the scene has one. For the camera setup, see Camera Rig.

Changing the Character​

Any pedestrian can be any of these characters. The first eight already have ready-made ego, road, or idle versions. The Actor Core characters are a bigger library, including children, that you turn into pedestrians yourself.

To use a different character, make a prefab variant of the pedestrian base prefab and put the character inside it. Then:

  1. Give the character's Animator the shared pedestrian_animation_controller.
  2. Connect the character to the Animator field of the pedestrian's movement component, on the root of the variant.

Assembling Custom Agents walks you through it step by step, for both ego and road pedestrians.