Skip to content

How to make a query that only runs when the given component has been mutated #19497

Closed Answered by rparrett
Dumpinground asked this question in Q&A
Discussion options

You must be logged in to vote

I think what's generally done now is something like

fn system(things: Query<Ref<Thing>, Changed<Thing>>) {
    for thing in things.iter().filter(|r| !r.is_added()) {
        // ...
    }
}

Relevant issue: #15070

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@Dumpinground
Comment options

@MrGVSV
Comment options

MrGVSV Jun 5, 2025
Collaborator

@MrGVSV
Comment options

MrGVSV Jun 5, 2025
Collaborator

Comment options

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