Skip to content

PickingInteraction change detection is triggered continuously #19464

Open
@djeedai

Description

@djeedai

Bevy version

0.16

What you did

mut query: Query<(&PickingInteraction, &Transform), Changed<PickingInteraction>>,

What went wrong

Triggers continuously instead of when mouse hovers/leaves.

Additional information

bevy_picking::hover::update_interactions() starts by clearing all components to PickingInteraction::None before recomputing. So even if the value didn't change, mutation has been recorded and it's too late. This makes it impossible to write systems which act on the first/last hover, which should be an extremely common pattern especially in UI (highlight a button, etc.).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-PickingPointing at and selecting objects of all sortsC-BugAn unexpected or incorrect behaviorC-UsabilityA targeted quality-of-life change that makes Bevy easier to useD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions