-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query::get_component
should mention that the compenent must be part of the query
#9011
Comments
nicopap
added
C-Docs
An addition or correction to our documentation
A-ECS
Entities, components, systems, and events
labels
Jul 1, 2023
It seems the doc is wrong, In the case mentioned in this issue, it should return a |
msvbg
pushed a commit
to msvbg/bevy
that referenced
this issue
Feb 26, 2024
# Objective We deprecated quite a few APIs in 0.13. 0.13 has shipped already. It should be OK to remove them in 0.14's release. Fixes bevyengine#4059. Fixes bevyengine#9011. ## Solution Remove them.
msvbg
pushed a commit
to msvbg/bevy
that referenced
this issue
Feb 26, 2024
# Objective We deprecated quite a few APIs in 0.13. 0.13 has shipped already. It should be OK to remove them in 0.14's release. Fixes bevyengine#4059. Fixes bevyengine#9011. ## Solution Remove them.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How can Bevy's documentation be improved?
Query::get_component
doesn't mention that it can only return components that are part of the query itself.The method itself is very niche, as it's mostly an optimization to avoid accessing several components when only one is necessary.
But the documentation mentions none of this. The only caveat is the following paragraph:
It's not enough!
Code seen in the wild (discord conversation):
This code will always panic! Independently of whether the
Entity
in question has aTransform
component or not. Sinceplayers
doesn't have access to theTransform
component, it cannot return a reference to it.What should be done
The method should get additional wording saying "can only return components present in the query" (better phrasing pending). This should be slapped at the front of the doc, maybe part of the first paragraph.
The text was updated successfully, but these errors were encountered: