RealDocs

AActor::OutsideWorldBounds

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

Description

Called by the engine when this actor is detected outside the hard limit on world bounds. The default implementation destroys the actor.

Caveats & Gotchas

  • The default implementation calls Destroy() — if you override this without calling Super or explicitly destroying the actor, it will remain alive in an invalid location outside the world, which can cause physics and rendering corruption.
  • This is triggered by the AWorldSettings::KillZ plane and the world bounds check in UWorld::Tick, not immediately when an actor crosses the soft bounds — there is some tolerance before this fires.
  • Pawns that fall below KillZ trigger FellOutOfWorld instead; OutsideWorldBounds applies to actors that exceed the XY extents of the world bounds box.

Signature

ENGINE_API virtual void OutsideWorldBounds()

Return Type

void

Example

Override to respawn instead of destroy C++
void AMyRespawnableActor::OutsideWorldBounds()
{
    // Do not call Super — we handle the out-of-bounds case ourselves
    UE_LOG(LogTemp, Warning, TEXT("%s left world bounds, respawning"), *GetName());
    SetActorLocation(RespawnLocation);
}

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.