In this lesson, you will learn how to align two independent characters perfectly during high-impact interactions like grapples or finishers by using a leader-follower synchronization approach.
The Challenge of Spatial Alignment
When two characters perform a choreographed interaction, they are separate Character blueprints. If you simply trigger a montage on both, small differences in their starting position or latency will result in "floating" hands or clipping meshes. To make the move look professional, we must treat one character as the "Master" (the initiator) and the other as the "Slave" (the recipient).
The Master-Follower Logic
The most reliable way to synchronize these animations is to use a Master Transform approach.
- The Initiator (Master): The attacker drives the movement. Use
Root Motionon the attacker’s montage to ensure the physical movement of the character capsule is baked into the animation. - The Recipient (Slave): The victim should not move themselves. Instead, you should attach the victim to the attacker’s socket or use
SetActorLocationAndRotationto teleport the victim to a "Sweet Spot" socket on the attacker the moment the grapple begins. - Synchronized Playback: You can use the
Play Montagenode on both actors. To keep them perfectly in sync, use aMontage_JumpToSectionor a customAnimNotifyto ensure that if one actor experiences a slight delay, the other waits or snaps to the frame-match.
For example, to snap the victim into place at the start of a grapple, run this logic in your interaction Blueprint:
// Logic to align the victim to the attacker
FTransform SocketTransform = AttackerMesh->GetSocketTransform(FName("GrappleSocket"));
VictimActor->SetActorTransform(SocketTransform);
VictimActor->AttachToComponent(AttackerMesh, FAttachmentTransformRules::SnapToTargetNotIncludingScale, FName("GrappleSocket"));
By attaching the victim to a socket on the attacker, the victim effectively becomes part of the attacker’s skeleton, forcing them to move in perfect spatial harmony for the duration of the animation. Once the animation completes, use an AnimNotify to detach the victim and return them to normal movement.
Key Takeaway: To ensure perfect synchronization, force the recipient to teleport and attach to the initiator’s movement-driven skeleton at the exact moment the animation starts.