[Question] How to destroy an actor properly in C++?

I´m new with Unreal, but I´m not new to C++.

As of version 4.25.1, calling K2_destroy is the same of calling Actor::Destroy with no params (in fact it is what the c++ code does).

This calls World->destroyactor, and so on.

That function sets a very interesting state : IsPendingKillPending()

This is my tick function, which verifies of the actor is currently begin destroyed:

void ::Tick(float DeltaTime)

{

Super::Tick(DeltaTime);

if (IsPendingKillPending())

	return;

… normal stuff here

}

1 Like