Allow inspecting World
for debugging entity issues and other
#3860
Labels
A-ECS
Entities, components, systems, and events
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
What problem does this solve or what need does it fill?
Trying to find why an
Entity
is not found in the renderWorld
by dumping that world with atrace!()
just before panic.What solution would you like?
Allow iterating somehow on entities, components, and archetypes, to allow debugging. Or at least allow dumping the archetypes. Currently only
Entities
andComponents
implementDebug
, notArchetypes
. And entities have no ID, only anEntityLocation
that seem to refer to the archetype. So one cannot locate an entity by ID into a world.What alternative(s) have you considered?
I don't see any.
trace!()
is already a last-resort technique which dumps in a rather indigestible format; I would have preferred allowing direct read-only iteration (though can understand if that's forbidden for ECS safety reasons).Additional context
Trying to debug
thread 'main' panicked at 'called
Result::unwrap()on an
Errvalue: NoSuchEntity',
. I know the entity ID, but cannot see if it's in the world, or what other entities are there that would guide my debugging.The text was updated successfully, but these errors were encountered: