To synchronize agents you can use the "sync" modules.
It is
particularly useful with horse/rider setup or any other setup where you need to
synchronize or constraint agents
from different
groups.
Let's see an example of a horse/rider setup.
Asset preparation
Since atoms syncronize the agents the animation clips used by the 2 agents must by sincronyzed during the creatin of the fbx from the animation scene.Usually the horse skeleton has an extra joint and the rig of the rider is constrained to this joint or your agents will be synced by Atoms during the simulation, their animation clips should be synchronized before you export them to an animation clip file (i.e. Fbx).
A good practice is to add an extra joint to the horse and constrain the rider main pelvis to it. Alternatively you can bake the animation of the rider main pelvis and the copy this animation it to the horse extra joint.
Export the animation clip clips as usual and load them inside atoms Atoms alongside with also the their agent typetypes.
Set the agent group order
Create two agent groups with a layout module (i.e. grid
layout
) and a clip reader or state machine module. On the first agent group set the
"agentType" to "horse", and on the second one set
it to "rider".
During the simulation Atoms
computes sequentially the agent groups in the scene
. In this case the agent
group containing the horses
should be computed first
. In order to do that you
should select the horse agent group and then the rider agent group
in this order. Then press the sync command from the Atoms shelf.
Under the hood a connection is made between the "message" attribute of the horse
group
and the "parentAgentGroup" attribute of the rider
group.
Adding the sync module
The last ste step is to do is add the sync module to the rider agent group. This module copied for each agent some metadata from parent copies some metadatas from the parent to the child agents. It also override overrides the current layout module, so for this reason you need to set the rider in the agent type attribute of the sync module . The you mast set the parent joint "agentType" field to "rider". You must also set the "parentJoint" name (the driver joint) and the rider "joint" name (the driven joint). You can add also
Finally, you might as well add an offset and active activate the keepOffset checkbox to mantain maintain the child joint animation. If the keepOffset is off then the module applies a normal constriant constraint without offset. If you need to copie copy more metadametadatas, expand the "metadata attribute " list of the modules and add the metadata names you want copy from the parent agentagents.
Rewind the scene and you will see the riders constrained to the horses.