Skip to content

Add inspect command for debugging entities and their components #1467

@alice-i-cecile

Description

@alice-i-cecile

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

Querying for specific components of entity is easy, but finding all of its components is necessarily hard, since it would require an exclusive system. This is particularly challenging for beginners who are attempting to understand the ECS or some specialized feature of it.

What solution would you like?

Add a Command that prints / provides information about the specified entity. Component names would be the MVP, but component contents may also be worth including if a suitable debug method exists for them.

What alternative(s) have you considered?

Implementing Debug for a World or a Query could also work well, and might be a nice complementary solution. See #1130 for this.

Serializing entities into a Scene could also work well, but still requires good introspection capabilities and is somewhat unnatural when you only want to quickly examine the results.

Additional context

This functionality would be very useful in the context of an editor: see bevy-inspector-egui for a wonderful prototype of this in a GUI context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleC-UsabilityA targeted quality-of-life change that makes Bevy easier to useD-TrivialNice and easy! A great choice to get started with BevyS-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