Comments (4)
The query is finding the entity, the reason your code panics is because it actually has multiple matches. (See where the error says value: MultipleEntities
).
If you change the code to print each match then you see that it matches: [(Some(()), None), (Some(()), Some(Foo))]
from bevy.
That's still Incorrect. It should have a single entity.
from bevy.
The documentation for AnyOf
says:
Query<AnyOf<(&A, &B, &mut C)>>
is equivalent toQuery<(Option<&A>, Option<&B>, Option<&mut C>), Or<(With<A>, With<B>, With<C>)>>
.
So Query<AnyOf<((), &Foo)>>
should be equivalent to Query<(Option<()>, Option<&Foo>), Or<(With<()>, With<Foo>)>>
which is then equivalent to Query<(Option<()>, Option<&Foo>)>
which also matches [(Some(()), None), (Some(()), Some(Foo))]
.
from bevy.
Bit unintuitive but guess that makes sense.
from bevy.
Related Issues (20)
- `Slab not found` error when running the `loading_screen` example. HOT 2
- Better `Dynamic*` mutable iteration HOT 1
- Easy reflection type traversal utils HOT 2
- Update/change fields of a reflected/dynamic type HOT 1
- `AnimationPlayer` doesn't explain how it is created
- Improve ergonomics for single-section `Text`s HOT 8
- `FromWorld` should mention how it works with `Default`
- multiple queries / SystemParam from `DeferredWorld` HOT 1
- Make `HierarchyQueryExt` work with `QueryState` HOT 2
- Bevy has no clear schedule for updating a camera's `Transform` when using a fixed time step HOT 6
- GenerateTangents in 0.14.1 can panic even though it is supposed to return Result HOT 7
- Split up `TextSection` into separate components HOT 1
- Proposal: `color!` macro HOT 6
- Ruby text support HOT 1
- Should EntityCommands consume self? HOT 2
- Remove duplicated CONTRIBUTING information HOT 3
- World::trigger variant that takes a &mut impl Event
- Much of the `bevy_animation` functionality is only accessible through `bevy_animation::prelude`
- Observer ordering/scheduling HOT 3
- Relative Cursor Position demo : crash HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bevy.