RealDocs

AActor::CallRemoteFunction

function Engine Since 4.0
#include "GameFramework/Actor.h"
Access: public Specifiers: virtualoverride

Description

Sends an RPC function call across the network via the actor's NetDriver. Returns true if the remote call was successfully queued; false if the actor has no valid network channel.

Caveats & Gotchas

  • Returns false (and silently drops the call) if the actor is not replicated or has no associated net connection. Always check HasAuthority() and the actor's replication state before relying on RPCs.
  • This is the actual send path — it is called by ProcessEvent after GetFunctionCallspace() indicates a remote destination. Overriding without calling Super will break all RPC delivery for the actor.

Signature

ENGINE_API virtual bool CallRemoteFunction( UFunction* Function, void* Parameters, FOutParmRec* OutParms, FFrame* Stack ) override;

Parameters

Name Type Description Default
Function UFunction* The RPC function to send.
Parameters void* Packed parameter data for the function call.
OutParms FOutParmRec* Out-parameter record for functions with output parameters.
Stack FFrame* Blueprint call stack frame, or null when called from C++.

Return Type

bool

Example

Trace RPC delivery in a custom actor subclass C++
bool AMyActor::CallRemoteFunction(UFunction* Function, void* Parameters, FOutParmRec* OutParms, FFrame* Stack)
{
    bool bSent = Super::CallRemoteFunction(Function, Parameters, OutParms, Stack);
    if (!bSent)
    {
        UE_LOG(LogTemp, Warning, TEXT("RPC %s not sent — no net channel"), *Function->GetName());
    }
    return bSent;
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.