UWorld::DestroyActor

Removes the actor from its level's actor list and generally cleans up the engine's internal state.

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/World.h

Include

#include "Engine/World.h"

Source

/Engine/Source/Runtime/Engine/Private/LevelActor.cpp

Syntax

bool DestroyActor
(
    AActor * Actor,
    bool bNetForce,
    bool bShouldModifyLevel
)

Remarks

Removes the actor from its level's actor list and generally cleans up the engine's internal state. What this function does not do, but is handled via garbage collection instead, is remove references to this actor from all other actors, and kill the actor's resources. This function is set up so that no problems occur even if the actor is being destroyed inside its recursion stack.

Removes the actor from its level's actor list and generally cleans up the engine's internal state. What this function does not do, but is handled via garbage collection instead, is remove references to this actor from all other actors, and kill the actor's resources. This function is set up so that no problems occur even if the actor is being destroyed inside its recursion stack.

Returns

true if destroy, false if actor couldn't be destroyed.

Parameters

Parameter

Description

ThisActor

Actor to remove.

bNetForce

[opt] Ignored unless called during play. Default is false.

bShouldModifyLevel

[opt] If true, Modify() the level before removing the actor. Default is true.

ThisActor

Actor to remove.

bNetForce

[opt] Ignored unless called during play. Default is false.

bShouldModifyLevel

[opt] If true, Modify() the level before removing the actor. Default is true.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback