I am trying to make a draggable GameObject that can be dropped within a container but when i'm releasing the mouse button even though the mouse is over the container (and the dragged object too) OnDrop isn't raised on my container. To make it work i must pick the dragged GameObject right at its edge so that the mouse is over the container but not the draggable when i release the mouse button
According to what I've seen drag and drop handled by unity is based on Raycasts and Raycasts could be configured to ignore objects that are in certain Layers thanks to a LayerMask the problem is that i wasn't able to find anything to apply a LayerMask
Is there a way to do this or any workaround that could let the drop target know that a dragged was dropped on him?
Raycast Targeton certain components. So when you release the drag, your mouse is over the object that you are dragging. You can just uncheck that box on objects that you are dragging, so that raycast would go through. If you want to use LayerMask, or you want to raycast multiple targets, you can create a custom raycasting solution and your own interfaces for it. \$\endgroup\$IDropHandleris realy based on Raycasts) there's quite nothing more i can do... \$\endgroup\$Raycast Targeton its components? Do you haveCanvas Groupon it? Does it haveBlocks Raycastsastrue? \$\endgroup\$