AActor::GetFunctionCallspace
#include "GameFramework/Actor.h"
Access: public
Specifiers: virtualoverride
Description
Returns a bitmask indicating where a given UFUNCTION should execute — locally, on the server, on clients, or some combination. The engine consults this before every RPC call to decide routing.
Caveats & Gotchas
- • The return value is a bitmask of EFunctionCallspace values (Local, Remote, NetMulticast, etc.). Returning the wrong value from an override will silently misroute RPCs, causing functions to run on the wrong machine or not at all.
- • Overriding this requires deep knowledge of UE's network call-space system. In practice almost no project code should override this; use standard UFUNCTION(Server/Client/NetMulticast) specifiers instead.
Signature
ENGINE_API virtual int32 GetFunctionCallspace( UFunction* Function, FFrame* Stack ) override; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Function | UFunction* | The function being evaluated for call routing. | — |
| Stack | FFrame* | The current Blueprint call stack frame, or null when called from C++. | — |
Return Type
int32 Example
Inspect call-space for a function (diagnostic use) C++
UFunction* Func = GetClass()->FindFunctionByName(TEXT("MyServerRPC"));
if (Func)
{
int32 CallSpace = GetFunctionCallspace(Func, nullptr);
bool bIsRemote = !!(CallSpace & FunctionCallspace::Remote);
UE_LOG(LogTemp, Log, TEXT("IsRemoteCall: %d"), bIsRemote);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?