# Inventory Slot with Click & Drag n Drop functionality

**URL:** <https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230>\
**Category:** UI\
**Tags:** unreal-engine, question, Blueprint\
**Created:** [April 8, 2025, 9:28am UTC](https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230 "2025-04-08T09:28:33Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![RagiinnPotato](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RagiinnPotato](https://forums.unrealengine.com/u/RagiinnPotato)\
**Post date:** [April 8, 2025, 9:28am UTC](https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230/1 "2025-04-08T09:28:33Z")

</div>

Hello, Im trying to make a inventory system where the place has the ability to drag n drop items into different slots within their inventory, but they also can click on a slot in their inventory and thus it will display information about what is in that slot.

So far I’m unable to have both work as one consumes the input and meaning the other will not work.  
Do i need to scrap using the on drag detected and make a custom system using on tick?

Any help is much appreciated

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 8, 2025, 9:32am UTC](https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230/2 "2025-04-08T09:32:51Z")

</div>

> [@RagiinnPotato](#):
>
> So far I’m unable to have both work as one consumes the input

Did you use a native button for the ability widget? If so, avoid it. A user widget can pass `Unhandled` to reach a layer underneath.

---

<div class="post-metadata">

**Author:** ![RagiinnPotato](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RagiinnPotato](https://forums.unrealengine.com/u/RagiinnPotato)\
**Post date:** [April 8, 2025, 9:43am UTC](https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230/3 "2025-04-08T09:43:34Z")

</div>

No i was using the on mouse down function overide.  
Does leaving it unhandled cause any issues?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 8, 2025, 9:49am UTC](https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230/4 "2025-04-08T09:49:24Z")

</div>

> [@RagiinnPotato](#):
>
> Does leaving it unhandled cause any issues?

It’s the solution. The widget (ability) can process the click → on mouse down pass `Unhandled` → click arrives at the slot underneath → process on mouse down and pass `Handled`. That’s providing you do not want to have yet another widget (or player controller) receive input.

---

<div class="post-metadata">

**Author:** ![RagiinnPotato](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RagiinnPotato](https://forums.unrealengine.com/u/RagiinnPotato)\
**Post date:** [April 8, 2025, 9:55am UTC](https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230/5 "2025-04-08T09:55:43Z")

</div>

I See. at the moment i don’t have another widget or player controller receive input. But that might change in the future.

What’s the best way of going about this? I saw your reply on a similar [post](https://forums.unrealengine.com/t/on-a-umg-button-how-to-handle-dragdrop-functionality-while-retaining-onclicked-functionality/470375/5) and i see the poster got it working with both of the replies.

I was confused though as to how would you trigger the on drag and drop function without using the “Detect drag if pressed” on the mouse button down

is there any other ways of being able to allow drag while also allowing the slot to be clickable?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 8, 2025, 10:14am UTC](https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230/6 "2025-04-08T10:14:38Z")

</div>

> [@RagiinnPotato](#):
>
> I was confused though as to how would you trigger the on drag and drop function without using the “Detect drag if pressed” on the mouse button down
> 
> is there any other ways of being able to allow drag while also allowing the slot to be clickable?

Try detecting the drag like so:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/0/c/30c08b3f2314118349db5474b08bf67802aa4966.png)

Essentially, this should return a `Handled` Drag Detection only if the user wiggles the mouse enough. A steady click with no wiggle should return `Unhandled`.

---

<div class="post-metadata">

**Author:** ![RagiinnPotato](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RagiinnPotato](https://forums.unrealengine.com/u/RagiinnPotato)\
**Post date:** [April 8, 2025, 10:27am UTC](https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230/7 "2025-04-08T10:27:43Z")

</div>

I feel so stupid. Im unsure how to implement it. if possible would you be able to show me a quick snippet on how to implement it?

As in implement some code if the player clicks but doesn’t move and implement this is a drag is detected

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 8, 2025, 10:31am UTC](https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230/8 "2025-04-08T10:31:51Z")

</div>

Can you show your `onMouseDown`? Where you detect the drag?

---

<div class="post-metadata">

**Author:** ![RagiinnPotato](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RagiinnPotato](https://forums.unrealengine.com/u/RagiinnPotato)\
**Post date:** [April 8, 2025, 10:35am UTC](https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230/9 "2025-04-08T10:35:07Z")

</div>

I original erased everything to try implement what you posted.

I believe i’m on the right track now is this how you would implement it?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/2/f/92f083c09f32952db8705bec7bab4dea8f65d163.png)

---

<div class="post-metadata">

**Author:** ![RagiinnPotato](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RagiinnPotato](https://forums.unrealengine.com/u/RagiinnPotato)\
**Post date:** [April 8, 2025, 10:37am UTC](https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230/10 "2025-04-08T10:37:24Z")

</div>

Also curious how did you get rid of the grid background on that photo?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 8, 2025, 10:37am UTC](https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230/11 "2025-04-08T10:37:39Z")

</div>

> [@RagiinnPotato](#):
>
> I original erased everything to try implement what you posted.

I’d do it like this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/e/2/de2e7c382c101848097b60c2c87fe9d839241c24.png)

Try it, see if that delivers. Do you need to `Branch` there? Because slot click would be implemented in the Slot widget and trigger on its mouse down.

---

<div class="post-metadata">

**Author:** ![RagiinnPotato](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RagiinnPotato](https://forums.unrealengine.com/u/RagiinnPotato)\
**Post date:** [April 8, 2025, 10:45am UTC](https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230/12 "2025-04-08T10:45:01Z")

</div>

> [@Everynone](#):
>
> click would be implemented in the Slot widget and trig

so essentially created a border that handles the drag and the on click functionality would be kept inside the widget itself, correct?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/5/2/d52737d92c2b676b13ba317ea5a2ff7291e0b184.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/e/9/de96c2cd816771bd4022b506ffb75e0410e8cca6.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 8, 2025, 10:46am UTC](https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230/13 "2025-04-08T10:46:12Z")

</div>

That looks spot on, should 🤞 work. Does it?

---

<div class="post-metadata">

**Author:** ![RagiinnPotato](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RagiinnPotato](https://forums.unrealengine.com/u/RagiinnPotato)\
**Post date:** [April 8, 2025, 10:46am UTC](https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230/14 "2025-04-08T10:46:51Z")

</div>

It does. Thank you very much for your help

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [May 8, 2025, 10:47am UTC](https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230/15 "2025-05-08T10:47:40Z")

</div>

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