Skip to content
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

Bevy picking DragDrop's Hit position is confusing. #16965

Open
Aqaao opened this issue Dec 25, 2024 · 0 comments
Open

Bevy picking DragDrop's Hit position is confusing. #16965

Aqaao opened this issue Dec 25, 2024 · 0 comments
Labels
A-Picking Pointing at and selecting objects of all sorts C-Bug An unexpected or incorrect behavior S-Needs-Design This issue requires design work to think about how it would best be accomplished

Comments

@Aqaao
Copy link

Aqaao commented Dec 25, 2024

Bevy version

0.15.0

[Optional] Relevant system information

rustc 1.84.0-nightly
Windows 10

What you did

I want get Drop position from Trigger<Pointer<DragDrop>>, use trigger.hit.position, I think it should store the position when left-button is released.

What went wrong

I'm getting hit position same the Trigger<Pointer<Over>>, it's not useful for DragDrop behavior.

Test

I made a demo to demonstrate it.
(I tested Mesh2d and Sprite only.)

drop.mp4

This is core codes.

fn over_observer(
    trigger: Trigger<Pointer<Over>>,
    mut debug_info: ResMut<DebugInfo>,
){
    debug_info.over_position = trigger.hit.position.unwrap().truncate();
}

fn up_observer(
    trigger: Trigger<Pointer<Up>>,
    mut debug_info: ResMut<DebugInfo>,
){
    debug_info.up_position = trigger.hit.position.unwrap().truncate();
}

fn move_observer(
    trigger: Trigger<Pointer<Move>>,
    mut debug_info: ResMut<DebugInfo>,
){
    debug_info.mouse_position = trigger.hit.position.unwrap().truncate();
}

fn drop_observer(
    trigger: Trigger<Pointer<DragDrop>>,
    mut debug_info: ResMut<DebugInfo>,
){
    debug_info.drop_position = trigger.hit.position.unwrap().truncate();
}

This full project:
test.zip

@Aqaao Aqaao added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Dec 25, 2024
@BenjaminBrienen BenjaminBrienen added S-Needs-Design This issue requires design work to think about how it would best be accomplished A-Picking Pointing at and selecting objects of all sorts and removed S-Needs-Triage This issue needs to be labelled labels Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Picking Pointing at and selecting objects of all sorts C-Bug An unexpected or incorrect behavior S-Needs-Design This issue requires design work to think about how it would best be accomplished
Projects
None yet
Development

No branches or pull requests

2 participants