AFM_Replication
Adaptive transform replication with interpolation, tolerance thresholds and owner-skip, for whole actors or tagged components.
What it gives you
- Smooth replicated movement for carried objects
- Adaptive sample rate that costs almost nothing at rest
- Authority that follows whoever picked the object up
Requires
Required by
Description
Transform replication in a VR project has a specific problem: objects are moved by hand, constantly,
in ways that do not compress well. BPC_Replication addresses it with three decisions.
It replicates with SkipOwner, so the player manipulating an object is never corrected by their own
data. It applies a Tolerance threshold so sub-threshold jitter is not sent at all. And it switches
sample rate based on movement — roughly 0.06 s while moving, 0.5 s at rest — so idle objects cost
almost nothing.
Authority follows possession. CheckIfOwnerChanged re-evaluates ownership so the player holding an
object drives it.
Setup
- Add
BPC_Replication_Actorto replicate a whole actor, orBPC_Replication_Componentwith a Component Tag to replicate one component. - Confirm
AFPNetDriveris the active net driver.
Usage
Replicating a carried object
Add BPC_Replication_Actor. Nothing else — the grip system and the replication component coordinate
authority between them.
Replicating one component
Add BPC_Replication_Component and set Component Tag to the component you want driven. Add
several instances to replicate several components of the same actor independently.
Tuning
Raise Tolerance for objects that jitter. Raise Tick Interval Without Movement for objects that rarely move.
Key properties
| Property | When to change |
|---|---|
Interp Speed | Raise to track authority more tightly, lower for smoother motion |
Tolerance | Raise to cut traffic from jittery objects |
Tick Interval During Movement | Lower only for fast objects where lag is visible |
Tick Interval Without Movement | Raise for objects that rarely move |
Extending
Derive from BPC_Replication and override getControlledSceneComponent, GetCurrentTransform and SetNewTransform to replicate something other than an actor or tagged component.
Performance notes
The two tick intervals are the main bandwidth lever. Defaults suit hand-held props; a scene with many replicated objects benefits most from raising the resting interval.
Example map
Map_Examples_Grip run with two PIE clients demonstrates carried-object replication.
Troubleshooting
Remote clients do not see movement. The component is missing, or AFPNetDriver is not active so the server RPC is dropped.
API reference
Every blueprint asset in this module. Expand an asset to see its members.
Components
BPC_Replication13 members
Base for the transform replication components: it owns the tick intervals, the tolerance, the interpolation speed and the replicated transform, but not the question of what is being moved. Add the actor or the component variant instead of the base, or subclass it and override Get Controlled Scene Component when neither of those fits.
| Kind | Name | Signature | Description |
|---|---|---|---|
| var | EnabledSettings | bool | Turns transform replication on or off at runtime without removing the component. |
| var | Interp SpeedSettings | float | How quickly remote clients interpolate towards the replicated transform. Higher values track the authority more tightly at the cost of looking less smooth. |
| var | ToleranceSettings | float | Minimum movement required before a new transform is sent. Raising this reduces network traffic for objects that jitter slightly. |
| var | Tick Interval During MovementSettings | float | How often the transform is sampled while the object is moving. Lower values give more responsive replication at higher bandwidth cost. |
| var | Tick Interval Without MovementSettings | float | How often the transform is sampled while the object is at rest. Kept deliberately high so idle objects cost almost nothing. |
| fn | getControlledSceneComponentScene Component | (out MainSceneComponent: SceneComponent) | Returns the scene component this component replicates. Override in a subclass to target something other than the actor root. |
| fn | GetCurrentTransformTransform | () → Struct_Replication_Transform | Returns the current transform of the controlled object together with whether it is worth replicating this frame. |
| fn | SetNewTransformTransform | (NewTransform: Struct_Replication_Transform) | Applies a received transform to the controlled object, preserving relative attachment when the parent matches. |
| event | Server_UpdateRoot | (DesiredTransform: Struct_Replication_Transform) | Sends the locally computed transform to the server so it can be relayed to the other clients. |
| event | UpdateTickIntervall | () | Switches between the moving and resting sample rates based on whether the object has moved recently. |
| event | CheckIfOwnerChanged | () | Re-evaluates which client owns this object, so authority follows the player who picked it up. |
| event | SetPhysicsHandle | (PhysicsHandle: PhysicsHandleComponent, AttachedComponent: PrimitiveComponent, Set: bool) | Registers or removes a physics handle driving this object, so replication accounts for physics-based manipulation. |
| event | SetEnabled | (Condition: bool) | Enables or disables replication at runtime. |
BPC_Replication_Actor3 members
Transform replication for the whole actor. Sends the actor's transform, made relative to its attach parent where it has one, and applies incoming transforms back to the actor. Add it to anything whose movement is driven locally, by grabbing or by physics, and has to be seen on the other machines.
| Kind | Name | Signature | Description |
|---|---|---|---|
| fn | SetNewTransformTransform | (NewTransform: Struct_Replication_Transform) | Applies a received transform to the owning actor. |
| fn | GetCurrentTransformTransform | () → Struct_Replication_Transform | Returns the owning actor's current transform and whether it needs replicating. |
| fn | getControlledSceneComponentScene Component | (out MainSceneComponent: SceneComponent) | Returns the owning actor's root component; this variant replicates the whole actor. |
BPC_Replication_Component4 members
Transform replication for one scene component rather than the whole actor. Set Component Tag to the tag on the component that should be followed; the first match is cached on the first look-up and its relative transform is what travels. Used where the actor itself does not move, as with the laser's end point.
| Kind | Name | Signature | Description |
|---|---|---|---|
| var | Component TagComponent | name | Tag identifying which component on the owner should be replicated. Lets several instances of this component each drive a different part of the same actor. |
| fn | getControlledSceneComponentScene Component | (out MainSceneComponent: SceneComponent) | Returns the component on the owner matching Component Tag. |
| fn | SetNewTransformTransform | (NewTransform: Struct_Replication_Transform) | Applies a received transform to the tagged component. |
| fn | GetCurrentTransformTransform | () → Struct_Replication_Transform | Returns the tagged component's current transform and whether it needs replicating. |