Replicated Properties

Marking a Property Replicated

Fusion piggybacks on the standard UPROPERTY(Replicated) reflection. Mark a property Replicated the way Unreal docs describe, and Fusion picks it up automatically. The opt-in is at the actor level, not the property level: adding a UFusionActorComponent to the actor is what brings all of its Replicated properties into Fusion's sync.

The supported wire types come from EFusionDataTypes in Types/FusionTypeProperties.h: primitive integers and floats (Byte, Int, Float, Double, Int64, and the unsigned and short variants), bool, the common math structs (FVector, FRotator, FQuat), FName, FString, object/class/actor references, custom USTRUCTs, and TArray containers.

C++

UPROPERTY(Replicated)
float Health = 100.f;

RepNotify and OnRep Handlers

UPROPERTY(ReplicatedUsing=OnRep_Foo) works as in stock Unreal. Fusion resolves the RepNotify function on each property at descriptor-build time and invokes it whenever the incoming replicated value differs from the local one.

Fusion batches per-packet notifications. When a packet updates several replicated properties, all the changed values are written first, then every affected OnRep_* fires in a single pass through UFusionClient::InvokeOnReps. An OnRep handler can read other freshly-replicated properties on the same actor without race conditions.

C++

UPROPERTY(ReplicatedUsing=OnRep_Health)
float Health = 100.f;

UFUNCTION()
void OnRep_Health(float OldHealth);

Networked Arrays

Fusion replicates TArray properties through a fixed-capacity slot pre-sized at descriptor-build time. Declare the capacity with the FusionArraySize UPROPERTY metadata key. The hard cap is FusionMeta::FusionArrayMaxSize, which is 64; project-wide default capacity for arrays without FusionArraySize set comes from UFusionOnlineSubsystemSettings::DefaultArraySize.

For richer arrays — anything that wants delta replication with PreRemove / PostAdd / PostChange callbacks similar to Unreal's FFastArraySerializer — Fusion ships FFusionNetworkedArray in FusionTypes.h. Declare the array container as a USTRUCT inheriting FFusionNetworkedArray and wire callbacks through FFusionArrayHooks.

C++

USTRUCT()
struct FInventory
{
    GENERATED_BODY()
    FUSION_BODY()

    UPROPERTY(Replicated, meta=(FusionArraySize="32"))
    TArray<FInventoryItem> Items;
};

Local State Copy Modes

UFusionActorComponent::LocalStateCopyMode controls how often the live UPROPERTY values are copied into the outgoing networked state. Auto (the default) copies every tick. Manual only copies on the tick after CopyLocalStateNextFrame() is called explicitly.

Use Manual when gameplay code writes intermediate values that should not stream out. A multi-step state transition that touches several replicated properties is the canonical case: with Manual, the intermediate frames never go on the wire — only the final state does.

C++

// In the constructor:
FusionActorComponent->LocalStateCopyMode = ELocalStateCopyMode::Manual;

// In gameplay code, after the multi-write transaction is finished:
ApplyDamageAndUpdateHitState(); // writes Health, LastHitTime, LastHitDirection
FusionActorComponent->CopyLocalStateNextFrame();

For pausing replication entirely — for example while a cinematic plays out locally — bAutomaticallySendUpdates and the ToggleNetworkSend(bool) method on the component are the coarser switches. They suppress all outgoing replication until re-enabled.

Replication Filters

Fusion's primary filter is Area-of-Interest. A UFusionSpatialHashInterestComponent on a PlayerController or Pawn tags owned actors with a 64-bit FFusionInterestKey based on their cell in a spatial hash, and subscribes the local client to the keys of nearby cells. The room only sends property updates for objects whose key matches one of the subscribed keys. The full strategy is in Interest Management.

At a lower level, the component exposes bSkipPreNetReceive, bSkipPostNetReceive, and a ComponentsToSkipPreAndPostNetReceive array. These suppress the engine's pre-/post-net-receive callbacks for specific scene components, useful when a component's receive hooks fight Fusion's own update flow.

The OnInterestEnter and OnInterestExit multicast delegates on UFusionActorComponent fire whenever a remote object crosses into or out of the local client's interest set. Use them to fade visuals, suspend AI, or skip per-tick work for objects the local client is no longer receiving updates for.

Smoothing for Transforms

For physics-driven roots — any actor whose root UPrimitiveComponent has Simulate Physics enabled — smoothing is handled by the UFusionPhysicsReplicationComponent that Fusion attaches automatically. Tuning lives in the Fusion|Forecast Physics block on the UFusionActorComponent: ErrorCorrectionType, PositionCorrectionLerp, Spring, Damper, MaxExtrapolationTime, and the rest. Full coverage is in Physics Replication.

For non-physics roots — plain AActor transforms, CharacterMovement-driven pawns — Fusion does not ship a public smoothing API on the Unreal plugin. Remote transforms reflect the values that arrive in the next replication packet, without interpolation. Apply smoothing in gameplay code on the remote side (typically in Tick against the replicated target) when the game needs visual smoothness between packets.

Back to top