Problem with Drag and Drop

Hello,
I’m working on a drag and drop inventory… and everything is working well, except for the drop.

For the drag, I created a DragWiget that is created as drag is detected on the Inventory Slot. This works as intended.

The problem is about the drop… in my Inventory Slot I can’t assign a texture on drop.


Does anyone know how to solve this?

Thank you everyone!

The *Operation *pin in the 2nd pic is the reference to the object created by Create Drag Drag Operation node in the 1st image - and it carries the Item Thumbnail as its Payload.

In the 2nd pic: drag a wire from Operation -> Get Payload -> Cast to Texture 2d. Plug that into the Texture pin.

That should be it.

Hello and thank you for your help :slight_smile:
I tried it, but it seems that it’s failing the casting (I put a print string after the Cast Failed output and it’s firing). Any idea on why this is happening?

What is Item Thumbnail? What type - you should cast to that. I simply assumed it’s Texture 2d.

It’s an Image from UMG. It should be able to accept a Texture 2d…

… image does accept a texture but Texture 2D object is not the same as Image (widget). [HR][/HR]
If you’re sending a thumbnail which is an Image widget, you cannot cast it to Texture 2d and expect it to work - they’re different objects.

edit: So this, for example:

Although there’s 10 ways you could do this. If you wanted to get just the Texture 2d, you’d need this kind of mental gymnastic:

Hope this makes sense!

Great, now it works! Thank you very much for your help!