bevyengine / bevyengine/bevy

Use `Name` component in warnings and errors regarding entities

Open
#18,261 1 comment 2 reactions 0 assignees View on GitHub
A-Cross-Cutting C-Usability D-Modest S-Ready-For-Implementation X-Uncontroversial
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

I sometimes see warnings like

`.../bevy_hierarchy-0.15.1/src/hierarchy.rs:49:19: Could not despawn entity 1684v2#8589936276 because it doesn't exist in this World. See: https://bevyengine.org/learn/errors/b0003`

in my game. There are usually a lot of different entities in serious games. So it's quite hard to find the exact entity after(!) it is already despawned.

## What solution would you like?

Maybe we could add some kind of mapping from despawned entities to their original `Name` component while despawning (only in debug mode). This would **really** help identifying these entities while developing.

There should be a rule on when the entity gets removed from this mapping, to prevent memory problems. Maybe after some update cycles, or something like that.

## What alternative(s) have you considered?

Guessing what entity it could be, by observing the situation as soon as the log message occurs.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.