RealDocs

UActorComponent::GetFunctionCallspace

function Engine Since 4.0
#include "Components/ActorComponent.h"
Access: public Specifiers: virtualoverride

Description

Determines where a UFUNCTION call should execute — locally, on the server, or on clients. This is the core routing hook the engine uses to dispatch RPCs for component functions.

Caveats & Gotchas

  • The return value is a bitmask from the EFunctionCallspace enum — values like FunctionCallspace::Local, FunctionCallspace::Remote, and FunctionCallspace::NetMulticast are OR'd together. Do not treat it as a simple boolean.
  • This is called by the engine's blueprint VM for every UFUNCTION invocation on a component, so overriding it incorrectly can silently break all RPCs on that component.

Signature

ENGINE_API virtual int32 GetFunctionCallspace( UFunction* Function, FFrame* Stack ) override;

Parameters

Name Type Description Default
Function UFunction* The UFunction being invoked.
Stack FFrame* The current script execution frame.

Return Type

int32

Example

Inspect call space in a custom component override C++
int32 UMyComponent::GetFunctionCallspace(UFunction* Function, FFrame* Stack)
{
    // Delegate to the owning actor for standard RPC routing
    if (AActor* Owner = GetOwner())
    {
        return Owner->GetFunctionCallspace(Function, Stack);
    }
    return Super::GetFunctionCallspace(Function, Stack);
}

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.