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
Debugging failed IntoSystem macro #16
Comments
Would you be willing to help me with collecting examples of error messages to showcase?
Could you help me make a list? |
Yep, let me dig through the spaghetti that is SystemParam.
There should be a few more in 0.5: EventReader and Archetypes (and friends, coming in The PR). |
I dug through it myself and managed to make a comprehensive list. I am basically done with the page, I'll make a PR (rather than pushing directly) so that you can give feedback. But first: Could you provide a good representative example of what the "arcane compiler error" looks like? I want to include it as a snippet so that people can know what this page refers to. I want an example of the compiler error that would be immediately recognizable to anyone encountering the issue. |
Also, what is the maximum supported number of total overall system parameters? |
16 |
Snippet:
This initially results in:
We fix that by adding a fn main() {
App::build()
.add_plugins(DefaultPlugins)
.add_system(malformed_system.system())
.run();
}
struct Component;
fn malformed_system(query: Query<&Component>, mut commands: Commands) {} which results in:
and the final fixed code is: use bevy::prelude::*;
fn main() {
App::build()
.add_plugins(DefaultPlugins)
.add_system(malformed_system.system())
.run();
}
struct Component;
fn malformed_system(query: Query<&Component>, mut commands: &mut Commands) {} |
Oh! I missed the part about Thanks for the snippets, i have all the information i need now. |
Stopgap solution for: bevyengine/bevy#1519
IMO, the correct choice here is to have a page for "I can't add my function as a system!" or something of the like. It should explain each of the options that impl
SystemParam
, and call out common mistakes for each. As an example, missing&mut
forCommands
, missing&
for components etc.The text was updated successfully, but these errors were encountered: