On Drop Function registers on wrong widget? Widget scaling beyond what is visible?

Hello everyone,
I implemented a basic Drag & Drop Inventory System containing of basically one big Inventory Widget with many Inventory Slot Widgets inside of it. When drag and dropping Items between the slot widgets everything works fine, however when trying to Drag and drop to certain adjacent Inventory Slots, the On Drop Function gets registered at the wrong slot and the Item is not moved (as seen in the attached video). The line you have to cross to register the On Drop on the right Slot is variable and depends on for example the monitor I use. Blueprint functunality is fine, I checked that. So it must be a problem with the Inventory Slot Widget, I guess maybe it actually is bigger than it renders? I will also link a screenshot of the Inventory Slot Widget. I tried shrinking it by removing a few of the borders, which did indeed change the behavior a little bit, but did not really fix the underlying issue.

Maybe you can give me a hint what I am missing. Thanks!


image

Edit: Here is another video I jut recorded. First I had the game running in windowed mode scaled down, then I ran it in fullscreen. As you can see the issue was way worse in the first try and got better, but not completely fixed when it ran in fullscreen. So it seems to be some sort of scaling issue I presume?

Bump. Still need help with this issue :slight_smile:

Here is another video with Widget Reflector. As you can see, as soon as I start the Drag and Drop Operation the adjacent Slots are only registered on the far edges.

I now changed DPI scale to always be 1. That made the problem better again on my 1440p monitor, on my 1080p monitor it was still as bad as before…

It seems like there’s a badly sized collider. Notice how you can move the item to the left fine just fine, but trying to the right doesn’t work until you’ve moved far enough.

Make sure the visual is not hit testable (children, too).
If that doesn’t work, try making the non-visual not hit testable as well. That shouldn’t be required, but you probably have a widget the wrong size (likely that pistol image, but it could also be the text).
The image might look something like this, which would be a problem.

Adding a second pistol also might help debug.
If you can print what slot it gets dropped on instead of just that it has been dropped, that would also help.

1 Like

For a second I thought that was the solution. I now set everything in my Inventory Slot Widget to Not Hit-Testable except for the Very outer size box. Unfortunately it still doesn’t work. But I suspect the same problem (some kind of faulty hitbox).
Here another video with your proposed changes, interesting how the behavior changes once I widen the screen.

And here an image of all the detail panels

And if it does help in any way, here is all the blueprint code for my Inventory Slot Widget:

1 Like

Nothing strikes me as obviously wrong with the blueprints or detail panels.
You are using self as drag visual, so that may cause some issues, but I don’t think that would cause the issues you’re facing.

The details and blueprint were really helpful in ruling out a ton of suggestions, but thanks to that I’m out of ideas. If you’re comfortable with dming me your project, I can test around and see if I can find the solution there, but other than that I don’t think I’ll be able to do more

1 Like

Interesting, I just reset the Drag visual to None and now everything is working… What do you usually use instead of self?

Edit: Okay I now made a DragVisual Widget (just a simple size box containing an image, both not hit-testable), that gets created before creating my Drag and Drop Operation. Appently that does the trick.
Thank you for your help @rokenrock !

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.