actors.destroy

Destroys an actor through K2_DestroyActor.

Syntax

ue.actors.destroy(actor: ActorReference) -> boolean?, string?

Parameters

ParameterTypeDescription
actorActorReferenceString query or actor descriptor.

Returns

TypeDescription
trueDestroy call succeeded.
nil, stringActor lookup or reflected call failed.

Example

local crate = ue.actors.find({ query = "BP_Crate_C", limit = 1 })[1]
if crate then
    ue.actors.destroy(crate)
end

On this page