AActor::IsSupportedForNetworking
#include "GameFramework/Actor.h"
Access: public
Specifiers: virtualENGINE_APIconstoverride
Description
Returns true if this actor can be referenced across a network connection. The default returns true for actors that are either named stably or have been assigned a NetGUID by the replication system.
Caveats & Gotchas
- • Returning false prevents the actor from being passed as a replicated property or RPC argument. Attempting to replicate a reference to a non-supported actor results in a null reference on the receiver.
- • This is distinct from IsNameStableForNetworking — a name-stable actor is always networking-supported, but a dynamically spawned actor can also be supported once the server assigns it a NetGUID.
- • Override to return false on actors that are purely local (e.g. editor-only helpers) to explicitly prevent accidental replication of references to them.
Signature
ENGINE_API virtual bool IsSupportedForNetworking() const override; Return Type
bool Example
Preventing a local debug actor from being used as a replicated reference C++
bool ADebugVisualizerActor::IsSupportedForNetworking() const
{
// This actor only exists locally in editor PIE — never replicate references to it
return false;
} See Also
Tags
Version History
Introduced in: 4.9
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?