Any way to know the on screen location of a drag and drop operation?

any way to know the on screen location of a drag and drop operation? this is for dragging and dropping an item from inventory to the world, i got everything working except highlighting the actor in the world we are moving the drag and drop to. my idea is while the drag and drop operation is happening, do a linetrace to the actor and have it glow. unfortunately so far, ive only been able to make it work with the on drop cancelled event for sending the item over. cant seem to find anything like “while dropping”

also keep in mind im destroying the inventory when i move the cursor out of it.

1 Like

Hey @,

To answer your first question, you can use these two nodes. If you are referring to the screen space location, you can use the node Get Mouse Location instead.
image

I have borrowed this small bit of blueprint from a much larger one that exists in the Content Examples sample project. I highly recommend looking into it as it breaks down material/color changes for the object when grabbed, picking up objects, and dropping them again. This is all handled within the actor MI_Sphere in that level’s folder.

To access the content examples sample project, go to the Samples tab in the Unreal Engine section of your Epic Games Launcher. The level in question is called Mouse Interface.

I hope this information helps, and good luck!

1 Like

thanks for the help, i actually had something similar set up but only in the drag and drop operation. i tried doing like in the example u mentioned, and put it in the actor to interact, but it only works if im not drag and dropping like in my problem (without dragging and dropping it works fine.
there’s actually an event already (that i was using on the actor called “on begin cursor over” which does pretty much the same as in the other stuff but not on tick.

still my problem remains…during the drag and drop i cant make the actor im aiming at to react :frowning:

have a look at this forum thread (https://forums.unrealengine.com/t/getting-mouse-position-during-drag-and-drop-umg/85760?u=alcyonelion1).
You could run the mouse location blueprint part that I provided in my answer in the overriden “Dragged” function to constantly know the mouse location in the world.