entity:destroyed

Shared

Fired when any entity instance is removed from the engine registry


Signal

"entity:destroyed"

Arguments

TypeNameDescription
userdataentityThe entity instance being destroyed

The entity reference is still valid during the handler.

  • Use it for last-moment cleanup before the entity is gone.
  • After the handler returns the entity is removed from the registry and marked as destroyed.

Example

Clean up on entity destruction
util.event.on("entity:destroyed", function(entity)
    core.engine.print("info", "Entity destroyed:", entity:get_type())
end)

On this page