Skip to content
Discussion options

You must be logged in to vote

One thing that is possible now in Bevy 0.8 is iterating over Children with iter_many.

fn children(query: Query<&Children>, text_query: Query<&Text>) {
    for children in query.iter() {
        for child in text_query.iter_many(children) {
            info!("{}", child.sections[0].value);
        }
    }
}

But other than that, we pretty much have to do a lot of manual work with multiple queries, e.g.

fn parent(query: Query<&Parent>, text_query: Query<&Text>) {
    for parent in query.iter() {
        for text in text_query.get(parent.get()) {
            info!("{}", text.sections[0].value);
        }
    }
}

It's also possible to construct recursive queries like this: #838 (comment) (upda…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Metadorius
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants