Skip to content

could not access system parameter Single #17178

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

Closed
brandon-reinhart opened this issue Jan 5, 2025 · 2 comments
Closed

could not access system parameter Single #17178

brandon-reinhart opened this issue Jan 5, 2025 · 2 comments
Labels
C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled

Comments

@brandon-reinhart
Copy link
Contributor

brandon-reinhart commented Jan 5, 2025

Bevy version

0.15.1

What you did

Ran my game after building with 0.15.1.

What went wrong

Many uses of Single<> now throw a runtime panic that "could not access system parameter". Previously, Single could be used to represent a "Zero or One" query that reduced query unpacking (avoids get_single) or avoids unnecessary panic risk (single).

In the current state, it appears that Single can only be used if one-and-only-one match exists for the query. This seems to me to reduce its usefulness substantially, as the runtime environment must be configured from the get-go with that singleton match being spawned or the system must be constrained to conditions where that component exists.

Single was, previously, useful for cases where we might have a singleton UI component, but that component might not exist at certain points during the game (for example, if an entity is not selected). With the new requirement that something must match for the system to not panic this usefulness seems to be gone. It makes quite a bit more sense to me that the system would simply not run, as it did in the past.

@brandon-reinhart brandon-reinhart added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jan 5, 2025
@brandon-reinhart
Copy link
Contributor Author

(As usual, my mood is sour at unexpected point release changes that result in large code refactors.)

@rparrett
Copy link
Contributor

rparrett commented Jan 5, 2025

More discussion over here: #17138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled
Projects
None yet
Development

No branches or pull requests

2 participants