RealDocs

AActor::IsRuntimeOnly

function Engine Since 5.0
#include "GameFramework/Actor.h"
Access: public Specifiers: virtual

Description

Returns whether this actor should only exist at runtime and be excluded from editor-world operations such as level saving and cooking preparation. The base class returns false; override to opt in for dynamically spawned actors that should never be serialized into a level.

Caveats & Gotchas

  • Actors returning true may be skipped by editor tooling that iterates world actors — make sure this does not break editor operations that depend on a complete actor list.
  • This is distinct from IsEditorOnly: IsRuntimeOnly excludes from the editor, while IsEditorOnly excludes from the runtime. They are mutually exclusive intents.

Signature

virtual bool IsRuntimeOnly() const { return false; }

Return Type

bool

Example

Mark a dynamically spawned manager as runtime-only C++
bool AMyRuntimeManager::IsRuntimeOnly() const
{
	return true; // Never save this into the level; it is always spawned at runtime
}

Version History

Introduced in: 5.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.