Search Unity

Question Card Drag and Drop and Area Detection Problem

Discussion in 'Immediate Mode GUI (IMGUI)' started by Rick_Jo, Jan 13, 2022.

  1. Rick_Jo

    Rick_Jo

    Joined:
    Dec 31, 2021
    Posts:
    4
    Hello Unity Community,

    upload_2022-1-12_18-0-25.png

    I have already implemented drag and drop to the gray area(It is now depeding on the pointer event data) but I would like to make it when the aqua card's border hit the gray area's border, it immediately snap to the gray area rather than keep track of the mouse cursor.

    I have tried collider, but without pointer event data, how can I set the position of the card to snap to the gray area? Or is there any other way of doing this without using a collider?

    I would be grateful if you can explain it with some code.