Hi, I have a 3D world in which the player moves using the mouse. I’ve also created a UI that the player can interact with.
What I’m trying to achieve now is for the player to be able to drag icons. This is working completely fine, except one thing: when dragging the UI icon element the player moves to the targeted location during drag. To drag a UI element I’m using “IDragHandler” and “IEndDragHandler”.
I’ve already implemented “!EventSystem.current.IsPointerOverGameObject()” but this does not work for dragging. Which is strange to me as the position of the dragged object is under the mouse, it should detect it.
Does anyone have any idea what else I could try?
Note that:
- I want the player to be able to drop the dragged UI icon anywhere on the screen and be able to get the World location of wherever he drops it
- I’m trying to avoid giving the UI elements a link to my player (otherwise I could put a bool)
Any help is greatly appreciated, thanks a lot!