Description
Returns true if this is a replicated actor that was placed in the level map at design time (a 'net startup actor'), as opposed to one dynamically spawned at runtime.
Caveats & Gotchas
- • Net startup actors are handled differently by the networking system on clients: they are pre-created from the level before the connection is ready, then matched to server-owned instances via GUID rather than spawned over the network. Misidentifying them can cause duplication or mismatch bugs.
- • This flag is set during level load and will not change for the lifetime of the actor. Dynamically spawned actors always return false even if they replicate.
Signature
ENGINE_API bool IsNetStartupActor() const Return Type
bool Example
Differentiate initialization path for placed vs spawned actors C++
void AMyActor::PostNetInit()
{
Super::PostNetInit();
if (IsNetStartupActor())
{
// Placed-in-level actor — world is already loaded, safe to query
InitFromLevel();
}
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?