Skip to content

How to get all components for a specific entity? #3332

Answered by MrGVSV
MrGVSV asked this question in Q&A
Discussion options

You must be logged in to vote

Update: This can be done a lot simpler now with just a World reference using World::inspect_entity.

fn my_system(world: &World) {
  // ...

  println!("{:#?}", world.inspect_entity(my_entity));
}

I believe this method was added in v0.9, whereas my original answer was likely from v0.5.

Replies: 3 comments 4 replies

Comment options

MrGVSV
Dec 15, 2021
Collaborator Author

You must be logged in to vote
2 replies
@OriginLive
Comment options

@kristoff3r
Comment options

Comment options

You must be logged in to vote
2 replies
@MrGVSV
Comment options

MrGVSV Oct 30, 2023
Collaborator Author

@mrchantey
Comment options

Comment options

MrGVSV
Oct 30, 2023
Collaborator Author

You must be logged in to vote
0 replies
Answer selected by MrGVSV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
A-ECS Entities, components, systems, and events
4 participants