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
None
Required by
AFE_Showroom AFS_Core_Pawn AFS_UX_Grip AFS_UX_Laser AF_Examples
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
- Enable
AFM_Replication. - 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 plugin. Expand an asset to see its members.
Components
BPC_Replication13 members
| Kind | Name | Signature | Description |
|---|---|---|---|
| var | EnabledSettings | bool | Turns transform replication on or off at runtime without removing the component. |
| var | InterpSpeedSettings | 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 | TickIntervalDuringMovementSettings | float | How often the transform is sampled while the object is moving. Lower values give more responsive replication at higher bandwidth cost. |
| var | TickIntervalWithoutMovementSettings | float | How often the transform is sampled while the object is at rest. Kept deliberately high so idle objects cost almost nothing. |
| fn | SetNewTransformTransform | (ref const NewTransform: Struct_Replication_Transform) | Applies a received transform to the controlled object, preserving relative attachment when the parent matches. |
| fn | GetCurrentTransformTransform | () → Struct_Replication_Transform | Returns the current transform of the controlled object together with whether it is worth replicating this frame. |
| 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. |
| 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
| Kind | Name | Signature | Description |
|---|---|---|---|
| fn | getControlledSceneComponent | (out MainSceneComponent: SceneComponent) | Returns the owning actor's root component; this variant replicates the whole actor. |
| fn | GetCurrentTransform | () → Struct_Replication_Transform | Returns the owning actor's current transform and whether it needs replicating. |
| fn | SetNewTransform | (ref const NewTransform: Struct_Replication_Transform) | Applies a received transform to the owning actor. |
BPC_Replication_Component4 members
| Kind | Name | Signature | Description |
|---|---|---|---|
| var | ComponentTagComponent | 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 | GetCurrentTransform | () → Struct_Replication_Transform | Returns the tagged component's current transform and whether it needs replicating. |
| fn | SetNewTransform | (ref const NewTransform: Struct_Replication_Transform) | Applies a received transform to the tagged component. |
| fn | getControlledSceneComponent | (out MainSceneComponent: SceneComponent) | Returns the component on the owner matching Component Tag. |