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 EFusionRPCTarget::SendToObjectOwner, and the owner mutates the replicated Health UPROPERTY so the new value fans out to every client via the normal replication path. The target enum and routing semantics are covered in RPC Basics.
C++
// On the shooter, called against the target actor:
SEND_FUSIONRPC(EFusionRPCTarget::SendToObjectOwner)
void ApplyDamage(float Damage, FVector HitDirection);
// On the target's owner:
void AHealthActor::ApplyDamage_Receive(float Damage, FVector HitDirection)
{
Health -= Damage; // Health is UPROPERTY(Replicated)
if (Health <= 0.f)
{
HandleDeath(HitDirection);
}
}
The RPC carries only the delta — damage amount, hit direction — never the resulting state. The resulting Health value belongs in a replicated property so late joiners and re-syncs see the current health without ever having received the original ApplyDamage call.
Cosmetic and Multicast Effects
One-shot cosmetic effects — explosion VFX, weapon-hit sparks, footstep SFX — fire on every client via EFusionRPCTarget::SendToAllClients. These calls are stateless: they spawn a particle, play a sound, and exit. No replicated property changes, no late-join story.
C++
SEND_FUSIONRPC(EFusionRPCTarget::SendToAllClients)
void PlayExplosionVFX(FVector HitLocation);
void AExplosionSource::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 EFusionRPCTarget::SendToMasterClient; the master validates the request and triggers the room-wide effect. The map-change case then surfaces locally on every client through OnMapLoadRequested, OnMapLoadPerform, and OnMapLoadDone on UFusionOnlineSubsystem.
C++
SEND_FUSIONRPC(EFusionRPCTarget::SendToMasterClient)
void RequestMapChange(FString MapName);
void AMapVoteActor::RequestMapChange_Receive(FString MapName)
{
if (!OnlineSubsystem->IsMasterClient()) return;
if (!IsApprovedMap(MapName)) return;
OnlineSubsystem->ChangeWorldByName(MapName, this);
}
Use SendToMasterClient for room-scoped decisions. For per-actor state changes — damage, item pickup, possession — route to the object's owner with SendToObjectOwner 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 — address the owner of a PlayerAttached actor with EFusionRPCTarget::SendToObjectOwner. 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(EFusionRPCTarget::SendToObjectOwner)
void GrantReward(int32 RewardId);
// On the recipient client:
void APlayerInventory::GrantReward_Receive(int32 RewardId)
{
LocalPlayerUI->ShowRewardPopup(RewardId);
}
Model "one player" as "the owner of this player-attached object", relying on 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).
Common Patterns and Anti-Patterns
Anti-pattern: a reliable, owner-routed SpawnExplosionRPC for cosmetic VFX. Wrong target (the effect should fire on every client, not just the owner) and wrong stewardship (the effect does not change authoritative state, so the reliable channel is being used to carry data that belongs in a multicast). Use SendToAllClients instead, as covered in Cosmetic and Multicast Effects above.
Anti-pattern: using SendToMasterClient 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 SendToObjectOwner instead.
| Scenario | Target | Stewardship |
|---|---|---|
| Apply damage to another player's pawn | SendToObjectOwner |
Owner mutates replicated Health; RPC carries only the delta. |
| One-shot VFX or SFX on every client | SendToAllClients |
Cosmetic only. Persistent state goes in a replicated property. |
| Request a map change | SendToMasterClient |
Master validates and drives ChangeWorld. |
| Grant a private reward to one player | SendToObjectOwner on a PlayerAttached actor |
Recipient updates local UI; if persistent, write a replicated property on the same actor. |
| Broadcast a chat message | SendToAllClients |
Treat each line as a one-shot multicast; history belongs in a replicated array if needed. |