RealDocs

AActor::K2_DestroyActor

function Engine Blueprint Since 4.0
#include "GameFramework/Actor.h"
Access: public Specifiers: virtualUFUNCTIONBlueprintCallableENGINE_API

Description

Destroys this actor at the end of the current frame, releasing it from the world. This is the Blueprint-facing wrapper for `AActor::Destroy()` — in C++ prefer calling `Destroy()` directly.

Caveats & Gotchas

  • Destruction is deferred — the actor remains valid for the rest of the current frame and any code continuing after this call. Do not assume the actor's components are gone immediately.
  • In C++ there is almost never a reason to call `K2_DestroyActor()` — use `Destroy()` instead. The K2 prefix is a UHT convention marking Blueprint-exposed virtual overrides of C++ functions.
  • Has no effect on actors that are not owned by the local authority (i.e., replicated actors on clients). Destruction must be initiated on the server.

Signature

ENGINE_API virtual void K2_DestroyActor();

Return Type

void

Examples

Destroy self when the player character overlaps this actor Blueprint
Event ActorBeginOverlap Overlapped Component Overlapped Component Other Actor Other Comp From Sweep Sweep Result Cast To MyCharacter Object Cast Failed As My Character As My Character Destroy Actor Target is Actor
Edit Blueprint graph Destroy self when the player character overlaps this actor
Drag node headers to move · Drag from an output pin to an input pin to connect · Scroll to zoom · Right-click for actions
Destroy actor after a delay via Blueprint-equivalent C++ call C++
// Prefer Destroy() in C++:
void AMyPickup::OnPickedUp()
{
	// Correctly marks actor for destruction
	Destroy();

	// K2_DestroyActor() is equivalent and also works,
	// but is the Blueprint-native entry point:
	// K2_DestroyActor();
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.