Home › How do I…? › How to replicate an interaction in multiplayer

How to replicate an interaction in multiplayer

Advanced Framework Pro replicates a grabbed or moved object with one component, BPC_Replication_Actor, over its AFPNetDriver. It handles interpolation and authority hand-off when a player picks something up. By the end of this your interaction will behave correctly for every player in a session.

At a glance

Project › net driver = AFPNetDriver   (see Installation)
Your actor
├─ BPC_Replication_Actor       whole-actor transform; Tolerance, two tick intervals
└─ BPC_Replication_Component   one component only; Component Tag
Own component with server RPCs: implement IOutsidePawnRPCInterface

Steps

  1. Confirm AFPNetDriver is the active net driver — see Installation.
  2. Add a BPC_Replication_Actor component to any actor whose transform must be shared.
  3. For a component rather than the whole actor, use BPC_Replication_Component and set its Component Tag.
  4. If your own component needs to call a server RPC, implement IOutsidePawnRPCInterface on it.
  5. Tune Tolerance and the two tick intervals for the object's movement profile.
Two clients side by side, both seeing the carried object
AFM_Replication_result.pngTwo clients side by side, both seeing the carried object
Two clients side by side, both seeing the carried object

Notes

Multiplayer

State components (BPC_State_*) and BPC_Interaction_Select already implement the RPC marker interface, so selecting and changing state replicate without extra work.

Performance

The default 0.06 s moving and 0.5 s resting intervals suit hand-held props. Raise the resting interval for objects that rarely move; lower the moving interval only for fast objects where lag is visible.