bevyengine / bevyengine/bevy

Add an inverse to `Changed` and `Added` filters

Open
#7,265 5 comments 0 reactions 0 assignees View on GitHub
A-ECS C-Feature D-Complex
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

Allows exclusive access based on `Changed` or `Added` component, similar to `With` and `Without`.

See https://github.com/bevyengine/bevy/pull/7264#discussion_r1073382489

This is very niche, but might help squeeze out some perfs.

## What solution would you like?

Add a `NotChanged` and `NotAdded` component that returns all entities that their `Changed` and `Added` counterparts do not return.

Am I missing something? It seems possible to discriminate based on those filters. Though it would likely require modifying the `AccessSet` content.

## What alternative(s) have you considered?

I added a `changed: Query<(), Changed>` parameter, and call `!changed.contains(&entity)`.

## Additional context

- https://github.com/bevyengine/bevy/pull/7264#discussion_r1073382489

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.