Houdini 19.0 Crowd simulations

Crowd state triggers and transitions

How to specify conditions that cause agents to change from one state to another.

On this page


At each step in the simulation, Houdini looks at each agent and checks a series of trigger nodes (for example “distance to target > 2”). A logic node is available to combine triggers. If a trigger applies, Houdini checks for a transition attached to the trigger to change the agent to a new state (for example, “walk” → “run”). Transitions can have a duration during which Houdini will automatically blend the animation clips of the old and new states.

Adding a transition

Transitions control when an agent changes from one state (for example, walk) to another (for example, idle). A transition requires three decisions:

  • The state you want agents to transition out of.

  • The condition which should trigger the transition.

  • The state you want agents to transition into.

  1. Go to the crowd simulation network.

  2. Create a Crowd Trigger node. In the parameter editor, set up the trigger condition (see “built-in trigger types” below).

    You can combine multiple triggers with “And”, “Or”, or “Not” logic using a Crowd Trigger Logic node.

  3. Create a Crowd Transition node and wire trigger node into it.

  4. In the parameter editor for the transition node, set the Start state and End state.

  5. Wire the output of the transition node into the transition_merge node (see the crowd DOP network).

Built-in trigger types

The Crowd Trigger node includes many useful test types, as well as a Custom option that lets you write a test expression in VEX.

Trigger type

What it does


Object bounds

Activates when the agent enters, leaves, or is inside some geometry.

Agents stop running when they cross the finish line of a race.

Object attribute

Activates based on the value of an attribute on some object near the agent.

Agents stop when they're at a red light, and walk when they're at a green light (use a “stop” attribute on the light object and have agents check if “stop” is 1).

Object distance

Activates based on how near to or far from an object (or point in a point cloud) the agent is.

Agents stop and turn around if they get too far from a base.

Object ray cast

Activates if an object is directly in front of an agent within a certain distance.

If an agent sees a painting, they stop to admire it.

Particle speed

Activates based on the agent’s speed.

Switch from a “walk” to a “run” to a “sprint” state/animation based on the agent’s speed.

Particle proximity

Activates based on the proximity of other agents.

Agents from different groups switch to a “fight” state when they get close together.

Particle attribute lookup

Activates based on the on the value of one of the agent’s attributes

Switch to a “dying” state if an agent’s “health” attribute gets too low.

Particle attribute comparison

Activates based on comparing the value of one of the agent’s attributes to the value of the same attribute on agents nearby

Agents run away from bigger opponents.


Activates based on the scene time (for example, if the current time step is more than 5 seconds into the scene)

Agents start running halfway through the scene.

Current state duration

Activates based on how long the agent has been in its current state

Guards leave the “alert” state after 30 seconds.

Animated parameter

Activates based on a parameter on the trigger node. You can keyframe the value of the parameter for manual control, or enter an expression to activate based on a function

Agents react to hand-animated events in the rest of the scene.

Custom VEXpression

Activates based on the value of a variable after running a VEX snippet. The trigger activates if the i@trigger variable is 1 at the end of the snippet

Use this for more complex or custom requirements.

Combining triggers

The Crowd Trigger Logic node lets you combine the results of two triggers using “and”, “or”, or “not” relations.


  • See agent attributes for useful attributes to use in custom triggers.

  • If multiple triggers/transitions activate for a given agent, which transition is chosen is technically undefined (but it’s probably the last transition in wiring order). However, it’s best to avoid this situation by not creating multiple trigger/transition paths with the same “from” state.

See also

Crowd simulations

Getting started

  • Basics

    An overview of Houdini crowd simulation concepts.

  • Setup

    How to set up and edit a crowd simulation.

The moving parts

  • Agents

    About agents, the moving actors that make up a crowd simulation.

  • States

    About agent states, the virtual mood of each agent which controls the agent’s animation and which behaviors it runs.

  • Triggers

    How to specify conditions that cause agents to change from one state to another.

  • Caches

    Tips for efficiently caching and loading crowd sims.



  • Diversity

    How to create a more realistic crowd by making agents look and act differently.

  • Attaching cloth

    You can add and constrain vellum cloth as part of agent shape geometry, and then simulate the cloth based on agent movements.


  • Foot planting

    How to set up agents to adapt their animation to terrain and prevent skating.

  • Terrain

    How to specify terrain geometry for agents to walk across.

  • Obstacles

    How to set up obstacles for agents to avoid.