Skip to content

DespawnOnExit / DespawnOnEnter causes log spam when despawning hierarchies #21832

@Lyndon-Mackay

Description

@Lyndon-Mackay

What problem does this solve or what need does it fill?

When you use DespawnOnExit, you need to ensure it is only used on the top level parents and is the only thing despawning the items.

Failing to do this will fill your logs with warnings while not a huge issue, it can bury other actual problems.

I would like a TryDespawnOnExit that will ignore despawned entities, as semantically I am saying "you should ensure it is despawned" rather then "You must be the one to despawn the entities".

Saves having to filter out logs that may contain more valuable information.

What solution would you like?

Either modifying DespawnOnExit or adding TryDespawnOnExit

What alternative(s) have you considered?

Using Tracing to filter out logs.
Making my own despawn component and activating on state transition.

I am currently marking components to not despawn.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-StatesApp-level states machinesC-BugAn unexpected or incorrect behaviorD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions