Playing a Motion Based on Speed / Orientation
(Automatic) With the Locomotion Behavior
The easier way is to use the Locomotion Behavior instead of the Motion Behavior. You can load several motion into this behavior and Golaem Crowd will automatically choose the right motion (or blend of motions) based on character (particle) speed and the translation contains in these motions.
(Advanced) Using the character's velocity ppAttribute
If the locomotion behavior is not reacting as you want, or if you need more control, you can use a velocity Per Particle attribute to control a network of Motion Behaviors. See ppAttribute Handling for more information about ppAttributes.
Let's see how we can start a behavior only if the velocity magnitude is greater than 0.5:
- Select its start trigger in the behavior editor, and check PPAttribute.
- Fill the name with "velocity" which is the name of the default velocity attribute.
- Change the operator to "greater than or equal", and input "0.5" in th value field.
NB: Because of Maya internals, the particles attributes values are wrong for the first frames, so it's better to protect the trigger by controlling that Current Frame >= 5.0.
You can use this with multiple motions in parrallel with different start/stop conditions, in order to play the walk, run, idle motion based on the particle speed.