Hello everyone.
I have a problem using the default drag and drop system that unreal offers in the umg. You will see when you hit the same item several times it disappears, when I look at the log there is no error. Maybe the problem is because of the method I use, also thank you very much for the help.
4.26.1 I am also still having the same exact problem. As part of my tests i try odd scenarios like rapidly double clicking on the draggable UI widget. this causes it to disappear. This occurs in a packaged project as well as in editor.
I’ll just say the original pic here removes the widget from the viewport first and then handles the OP - not the safest thing to do and it may end up causing issues.
The longer I look at it, the worse it gets. The widget should remain hidden (or at least ensure its referenced properly) until the drop (or until we no longer need it). If the GC swoops in and scoops the widget, this is going to get messy.
@Hunanbean: Post a new question with the way you’re handling things. Perhaps someone will be able to poke holes in it.
Thank you for the response. It will take me a bit to get some screen shots together, but in the meantime, here is a link to the completed project UnrealGaimeDev Edit+ from following this tutorial UnrealGaimeDev Inventory Tutorial Series
After some further attempts, i have been following the official
Creating Drag and Drop UI
Epic Unreal documentation
and the result is working as expected. I am attempting to follow this proper procedure to solve the issue in the project. If i am unable to accomplish this, i will do as you suggested and open a Question with screenshots, etc. Thank you again for your response and insight @Everynone
Hi, in the end I chose to do it in 3D and not with umg, Of course my application was not for an inventory but for a minigame.However I would like to know if there is a solution to implement it in the future.
If you could isolate the issue (or at least point to circumstances where it can be triggered), include a couple of screenshots and a rough description of how things are supposed to work, I’ll have a look, sure.
Can’t promise a solution upfront, of course, but I’ve been dealing with drag&drop for quite some time now so I’m at least familiar with its quirks.
An easy way to trigger it in the downloadable project would be to start dragging the inventory window and press Esc. Oh, i just recalled. that project needs modification to work on anything above 4.17. I have modified my local copy, but as a direct download, other issues would need to be resolved before it could even be tested.
i am not sure if they will make sense in their context (but that is based on my limited UE4 knowledge, not yours) but here are the relevant BPs. I think this covers all the required information.
Basically, grabbing the Inventory window and moving it works fine, but if i press Esc while doing that, the Widget disappears and will not come back. Now, in the previously mentioned official documentation, pressing Esc just destroys the temporary widget, and leaves the original in its place. This is the functionality i am looking for. The same things happening with the main inventory window happens with the slot contents as well (BPs not included for individual slots, as the reason is the same). I guess bottom line is i need to find a way to make a temporary widget that moves then updates the original to it position, instead of how it is now, which destroys the widget if the OnDrop does not get triggered.
Thank you again for taking the time to try to help. If you need any further information, i will try to provide it.
Ok. I have adjusted things to where it more closely matches the previously mentioned official documentation. Now the only destroyed on ESC or failure is the translucent outline, but the original stays in place. Not exactly what i was try to acheive, but good enough to move forward. Ideally, i would like to take a snapshot and make that the current translucent, hide to original, and reverse on drop. But, since this solves the initial problem, i will post it as a solution.