bevyengine / bevyengine/bevy

Bevy picking DragDrop's Hit position is confusing.

Open
#16,965 2 comments 0 reactions 0 assignees View on GitHub
A-Picking C-Bug S-Waiting-on-Author
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## 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>`, 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>`, it's not useful for `DragDrop` behavior.

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

https://github.com/user-attachments/assets/908e7e8f-54b6-4cae-86ac-c543c82711ed

This is core codes.
``` rust
fn over_observer(
trigger: Trigger>,
mut debug_info: ResMut,
){
debug_info.over_position = trigger.hit.position.unwrap().truncate();
}

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

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

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

This full project:
[test.zip](https://github.com/user-attachments/files/18245464/test.zip)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the supplied demo and comparing hit.position on Pointer, Pointer, Pointer, and Pointer. Trace the picking event entry points for DragDrop and determine whether its position should represent the left-button release location; done means the reported drop position matches that release location.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.