Skip to content

could not access system parameter Single #17178

Closed
@brandon-reinhart

Description

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.

Metadata

Assignees

No one assigned

    Labels

    C-BugAn unexpected or incorrect behaviorS-Needs-TriageThis issue needs to be labelled

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions