Example Uses

Reliable State-Changing Calls

The classic shared-authority RPC is "ask the owner to mutate authoritative state." A shooter that hits another player's pawn is not the owner of that pawn, and shared authority forbids it from writing the target's Health directly. Instead, the shooter sends a reliable RPC to the target's owner with TargetObjectOwner, and the owner mutates the replicated Health UPROPERTY so the new value fans out to every client via the normal replication path. The target types and routing semantics are covered in RPC Basics.

C++

// On the shooter, called against the target actor:
SEND_FUSIONRPC(TargetObjectOwner)
void ApplyDamage(float Damage, FVector HitDirection);

// On the receiving client that is the owner
void ApplyDamage_Receive(float Damage, FVector HitDirection)
{
    Health -= Damage; // Health is UPROPERTY(Replicated)
    if (Health <= 0.f)
    {
        HandleDeath(HitDirection);
    }
}

The RPC carries only the value originally sent and is not context aware. The resulting Health value belongs in a replicated property, and it's up to the developer to handle any edge cases.

Cosmetic and Multicast Effects

One-shot cosmetic effects — explosion VFX, weapon-hit sparks, footstep SFX — fire on every client via TargetAllClients. These calls are stateless: they spawn a particle, play a sound, and exit. No replicated property changes, no late-join story.

C++

SEND_FUSIONRPC(TargetAllClients)
void PlayExplosionVFX(FVector HitLocation);

void PlayExplosionVFX_Receive(FVector HitLocation)
{
    UGameplayStatics::SpawnEmitterAtLocation(GetWorld(), ExplosionTemplate, HitLocation);
    UGameplayStatics::PlaySoundAtLocation(GetWorld(), ExplosionSound, HitLocation);
}

Late joiners intentionally miss the effect — they were not in the room when the explosion fired, and the explosion does not persist. Anything that must survive a join (a destroyed wall, a scorch decal, a damaged texture) lives in a replicated property on a networked actor, not in the multicast RPC.

Master Client Requests

Room-scoped decisions — map change, game-mode switch, round reset — flow through the Master Client. Any client can request the action by sending TargetMasterClient; the master validates the request and triggers the room-wide effect.

C++

SEND_FUSIONRPC(TargetMasterClient)
void RequestMapChange(FString MapName);

void RequestMapChange_Receive(FString MapName)
{
    if (!OnlineSubsystem->IsMasterClient()) return;
    if (!IsApprovedMap(MapName)) return;
    OnlineSubsystem->ChangeWorldByName(MapName, this);
}

Use TargetMasterClient for room-scoped decisions. For per-actor state changes — damage, item pickup, possession — route to the object's owner with TargetObjectOwner instead, even when the owner happens to be the Master Client.

Per-Player Targeted Calls

To send an RPC to one specific player — a private reward, a personal notification — use TargetObjectOwner. Only that one client receives the call. There is no per-ActorNumber RPC target, so the player-attached-actor pattern is the way to model "one player" as a routing destination.

C++

// Called on the recipient's player-attached actor:
SEND_FUSIONRPC(TargetObjectOwner)
void GrantReward(int32 RewardId);

// On the recipient client:
void GrantReward_Receive(int32 RewardId)
{
    LocalPlayerUI->ShowRewardPopup(RewardId);
}

Model "one player" targets using the rules in Ownership to keep the owner mapping correct. If the project does not already have a PlayerAttached actor per player, the PlayerState is the natural choice — Fusion auto-attaches a UFusionActorComponent with PlayerAttached ownership to every APlayerState (see Game Classes).

Using Builtin RPCs

Example on how to send an RPC using the blueprint event system. Ensure the initially invoked event is set to Replicates:run on server. After that define an event with normal Replicates:Multicast and call that from within the server defined event.

Blueprint defined Unreal RPCs
Blueprint defined Unreal RPCs

Example on how to send an RPC using the builtin c++ API. Ensure the initially invoked method is defined with: UFUNCTION(Server, Reliable). After that define a method with: UFUNCTION(NetMulticast, Reliable) and call that from within the server defined method.

C++

UFUNCTION(Server, Reliable)
void RPCTest_Unreal_Nested_Struct_ServerRPC(FRPCTestArrayElement Values);
void RPCTest_Unreal_Nested_Struct_ServerRPC_Implementation(FRPCTestArrayElement Values)
{
    RPCTest_Unreal_Nested_Struct_ClientRPC(Values);
}

UFUNCTION(NetMulticast, Reliable)
void RPCTest_Unreal_Nested_Struct_ClientRPC(FRPCTestArrayElement Values);
void RPCTest_Unreal_Nested_Struct_ClientRPC_Implementation(FRPCTestArrayElement Values)
{
}

Common Patterns and Anti-Patterns

Scenario Target Stewardship
Apply damage to another player's pawn TargetObjectOwner Owner mutates replicated Health
One-shot VFX or SFX on every client TargetAllClients Cosmetic only. Persistent state goes in a replicated property.
Request a map change TargetMasterClient Master validates and drives ChangeWorld.
Grant a private reward to one player TargetObjectOwner Recipient updates local UI; if persistent, write a replicated property on the same actor.
Broadcast a chat message TargetAllClients Transient event sent to all clients; history belongs in a replicated array if needed.

Anti-pattern: using TargetMasterClient to flip a per-actor flag. The master is not the owner of that actor, so the write either bounces (because shared authority forbids it) or stomps replication (if the master mistakenly owns the actor too). Route to TargetObjectOwner instead.

Back to top