Unreal Engine 5 Tutorial - Inventory System Part 9: Drag and Drop

  Рет қаралды 32,371

Ryan Laley

Ryan Laley

Күн бұрын

Пікірлер: 91
@louthinator
@louthinator 7 ай бұрын
IMPORTANT STEP: inside the OnKeyDown section of W_PlayerMenu please add a "Cancel Drag Drop" node after the branch and before the remove from parent. It means if you're drag dropping and close your inventory without letting go first it won't break the drag/drop
@swipsi6858
@swipsi6858 Жыл бұрын
for anyone running into the problem of not being able to drag any slot at all, make sure you use the OnPreviewMouseButtonDown (override-)function instead of the OnMouseButtonDown one.
@WitcherKING
@WitcherKING Жыл бұрын
Yes This fixes it.
@РУССКИЙ_СОЛДАТ
@РУССКИЙ_СОЛДАТ Жыл бұрын
Thx!✌
@Guizinhoo_
@Guizinhoo_ 11 ай бұрын
thank you mann!!!!!!!!! I've been trying to resolve this for over 30 minutes
@intrepidoak2618
@intrepidoak2618 10 ай бұрын
Also I missed setting the Is Mouse Button Down to the LMB
@brucemozart3665
@brucemozart3665 6 ай бұрын
Thank you!
@samroe3d
@samroe3d 11 ай бұрын
4:55 somehow I missed this and it wasted 30 minutes for me :P
@Behporsuk
@Behporsuk 11 ай бұрын
Thnxx!!! hahaha same problem for me ...
@perroloco728
@perroloco728 7 ай бұрын
Hero!
@aryanbarure1479
@aryanbarure1479 5 ай бұрын
I love you buddy
@GoatCliffs
@GoatCliffs 12 күн бұрын
Lmao same
@antonjjohansson
@antonjjohansson 2 жыл бұрын
Yeez, just binged your episodes, great tutorial and you explinations are very detailed, great job.
@NoahBelstad
@NoahBelstad 6 ай бұрын
for some reson it does not detect the on prewiev mouse button click i added a print statment but it dident even print anything when put right after the on prewievm ouse click start
@rell0223
@rell0223 2 жыл бұрын
1:00 you can also use "on drag detected." Similar, but rather than just detecting a mouse down, its also looking for mouse movement and im pretty sure already has the operation structure as a return value
@kekuskekus5480
@kekuskekus5480 Жыл бұрын
If someone will get stuck like me with Slots not being dragged - Find "Visibility" boxes in both of your slot widgets and set it from "Not-Hit Testable" to "Visible" , im using UE 5.1
@oliverholmberg1462
@oliverholmberg1462 11 ай бұрын
Thanks man!
@Abc-tx4zr
@Abc-tx4zr 2 ай бұрын
can you further explain im completely new
@snarktips4667
@snarktips4667 25 күн бұрын
do you also do this for the w_drag_preview?
@stormrungaming
@stormrungaming Жыл бұрын
Is there anything I need to do for 5.2?.. I can drag any slot except the one with the picture. I figured it was the picture on top of the button or something, but Idk. So empty slots give me an error on the log when I try an move them saying there's no item but they are draggable. however, the apple slot cant be touched or moved it seems.
@stormrungaming
@stormrungaming Жыл бұрын
nvm, I figured it out. In W_InventorySlot and PreviewMouseButtonDown, the first branch was backwards. I changed the True to go directly to the return node and the false to carry out the function.
@ArtVandelayInc
@ArtVandelayInc Жыл бұрын
@@stormrungaming Thank you for being generous and writing this. This solved the problem for me too
@makzy_smart
@makzy_smart 11 ай бұрын
Thank you for taking the trouble and commenting again with your solution. Helped me too!
@fishfryer87
@fishfryer87 Ай бұрын
Thank you sooooooo much actually saved me so much time!
@NuhgitKyng
@NuhgitKyng 7 күн бұрын
Somehow i did this as well, i am adapting my own inventory system, and was watching for the Drag and drop and i somehow made this mistake Cheers
@chrispell3204
@chrispell3204 8 ай бұрын
Thank you for making these tutorials, i'm a novice with the blueprints, i've run into a problem where i'm making this for a topdown game mode, once the inventory is used in game it seems to disrupt the clicking inputs for character movement, disabling "show mouse cursor" fixes it but for obvious reasons this doesnt work for me as the player needs the cursor to move around, can anybody help tweak this?
@Abc-tx4zr
@Abc-tx4zr 2 ай бұрын
I have a couple problems. A. How do i stop the player from being able to interact with the world while the inventory is displayed? B. I cant click on my inventory without adding another inventory beneath it, so my inventory appears to darken, ie.every time i click on my inventory and hit the i key it opens another inventory. I think it has something to do with my inventory grid but i dont now what to change so it stops layering multiple inventory's over one another
@Spectre_Beats
@Spectre_Beats Жыл бұрын
You are the best Ryan!!! Keep it up - I love the Halo helmet in the back, I got that same one in my room!
@Cvusmo
@Cvusmo Жыл бұрын
I'm using UE 5.3.2. IF you're having issues with the DrawPreview not functioning problem change these settings in the WB_DrawPreview: 1. IMAGE - make sure your image size is the same as what you have in your INVENTORYSLOT blueprint. 2. Keep the tint to 1 and color/opacity to 1 in the details panel of the DrawPreview. 3. The border that the image is attached to, set the Brush Color ALPHA channel to 0. (transparent) I'm not sure what changed with 5.3.2 and why the variables created in the blueprint designer cannot be changed to being editable or expose on spawn in the graph. Above is the workaround that has allowed the image to show when dragging items in inventory.
@Ilaijo
@Ilaijo Жыл бұрын
you are an absolutely genius,thanks for the videos
@DadGeekUK
@DadGeekUK Жыл бұрын
Controller support has been included so far. Is this the point where we're abandoning it or is it covered by a later lesson?
@imwheeliebad
@imwheeliebad Жыл бұрын
Sure hope not! from what i've learned though I am going to attempt this myself (will share if I succeed)
@shak-alt1235
@shak-alt1235 Жыл бұрын
@@imwheeliebad bro didn’t share
@Tegurd
@Tegurd Жыл бұрын
@@shak-alt1235 Some say he's still attempting to this day
@darrenj.griffiths9507
@darrenj.griffiths9507 8 ай бұрын
Did you manage to get controller working with this?
@gingerdehinger1091
@gingerdehinger1091 Жыл бұрын
so using 5.3 here and i was able to figure out why the drag and drop wouldnt work for me, in my player menu the inventory grid was set to not hit testable self and all children, it should be set to visible, i think that any of the widgets having that setting wrong at any point could lead to it not working, make sure you look through the heirarchy in all your widgets and under behavior is visibilty, make sure its visible
@gingerdehinger1091
@gingerdehinger1091 Жыл бұрын
alsoin inventory slot i did swap on preview mouse button down the first branch where true runs the return node and false runs the functionality
@matternst8274
@matternst8274 16 күн бұрын
Thanks for the comment, this worked for me
@emiraydin1625
@emiraydin1625 Жыл бұрын
how can i do this system for inventory slot to equipment slot ( different user widget ) i want to equip items with drag and drop
@benjamin71965
@benjamin71965 Жыл бұрын
I had this question aswell, I was thinking about using a inventory component on a actor that is connected to the equipment widget. When you drag an item to the slot check or the slot is an equipment slot with a bool. Then only allow drop the item when its equipment. But haven't tried it yet
@Vahsir7
@Vahsir7 8 ай бұрын
one mistake i did was that i didnt assign mouse left button click on nodes "is mouse button down" and "detect drag if pressed" under on preview mouse button function
@chickennugget7339
@chickennugget7339 3 ай бұрын
Does anyone know how to make this work with a gamepad, as well? I'm using 5.4 and can't seem to figure it out for the life of me.
@hencytjoe
@hencytjoe Жыл бұрын
Thanks yet again for this awesome tutorial!
@RyanBriggs-g9v
@RyanBriggs-g9v Жыл бұрын
i get this error: LogPlayerController: Error: InputMode:UIOnly - Attempting to focus Non-Focusable widget SObjectWidget [Widget.cpp(917)]! what does it mean please?
@Jack_JRR
@Jack_JRR 2 жыл бұрын
I'm unable to drag the item, I've go over the video 4 times now and can't find anything I did differently
@EmperorVigor
@EmperorVigor Жыл бұрын
Maybe you missed to connect a return node? I had that.
@KnitterX
@KnitterX Жыл бұрын
@@EmperorVigor That's exactly what my problem was, thanks! It was the step at 4:55
@EmperorVigor
@EmperorVigor Жыл бұрын
@@KnitterX Glad to hear that you got it sorted! That's the one I missed as well :)
@Jack_JRR
@Jack_JRR Жыл бұрын
@@EmperorVigor I didn't see these comments lol, mine is connected and still getting the issue
@calumyuill
@calumyuill Жыл бұрын
@@Jack_JRR @1:53 check if you set 'Is Mouse Button Down' and actually choose Left Mouse Button or use the keyboard icon and click left mouse button
@ademkoluk5047
@ademkoluk5047 Жыл бұрын
Thank you so much
@VolcanoMilk
@VolcanoMilk 11 ай бұрын
REALLY specific bug: I can't drag items between matching slots. ie. Slot 1 to Slot 1, Slot 2 to Slot 2 ect. Anyone else have this?
@davidleathers2609
@davidleathers2609 2 жыл бұрын
Thanks you have awesome tutorials!
@shak-alt1235
@shak-alt1235 Жыл бұрын
I have an issue where the block will not be destroyed on the first e click but second one idk what did this if anyone can help that’d be great it also adds “Apple” to inventory on the first click
@maroela2
@maroela2 8 ай бұрын
Do you maybe have two 'Apples' spawned?
@play-good
@play-good 2 жыл бұрын
Thx Man 😍
@Sohneg
@Sohneg 10 ай бұрын
For some reason I can't see the images. I can drag it and I see then a white circle. In the inventory itself there is all black. Somebody had same problem?
@Sohneg
@Sohneg 10 ай бұрын
Nevermind. I changed the name of the item in the data table and forgot to adjust also my item (actor)
@domenicopetrillo
@domenicopetrillo 5 ай бұрын
@@Sohneg hii i have the same problem but i don't get your solution sorry😅
@zaygt404
@zaygt404 Жыл бұрын
i have a problem, i cant drag the slot, i cant see the dragging slot
@zaygt404
@zaygt404 Жыл бұрын
PLS HELP
@hencytjoe
@hencytjoe Жыл бұрын
@@zaygt404You probably just missed some connection somewhere. Happens sometimes. Just rewatch the video from the beginning and see if you missed something. It will be a lot quicker because you got the majority of things right. It can be a small, simple connection.
@stormrungaming
@stormrungaming Жыл бұрын
@@hencytjoe If you look at the comments section.. There is an obvious flaw.. or outdated. But there are workarounds to make it work. But I guarantee if you follow the video.. you will run into the exact problem nowdays.
@ManuelBindi
@ManuelBindi Жыл бұрын
i hope Epic will change the accessibility of the drag and drop operation in something less trickery, it should not take so much time to script such a common interface operation, it is widely used by lot of users.
@hencytjoe
@hencytjoe Жыл бұрын
It's probably under construction, it sounds like it's something they'd do.
@senuzul
@senuzul Жыл бұрын
I'm able to drage the item, but when I drag it it only shows the circle material. Why doesn't the thumbnail show up?
@leaderofthenewbencrusades746
@leaderofthenewbencrusades746 Жыл бұрын
same problem for me here, where you able to figure it out?
@mr.sunshine4432
@mr.sunshine4432 Жыл бұрын
@@leaderofthenewbencrusades746 In Inventory slot got to function 'on drag detected': you have to add the ItemID tot the create Drag preview Widget ;)
@leaderofthenewbencrusades746
@leaderofthenewbencrusades746 Жыл бұрын
@@mr.sunshine4432 Thanks for the help, but I figured out the problem. For some reason I could only get it to show if I put it in a canvas instead.
@Revinga.
@Revinga. Жыл бұрын
Chances are you did the same thing I did. I put the material on the image instead of the border.
@antoinelefrancois4998
@antoinelefrancois4998 Жыл бұрын
HELPPPP! I can drag and drop any slot EXCEPT the apple one XD i did the video 5 times and its still doesn't work. What a did wrong?? Thx!
@kekuskekus5480
@kekuskekus5480 Жыл бұрын
Find "Visibility" boxes in both of your slot widgets and set it from "Not-Hit Testable" to "Visible" , im using UE 5.1
@stormrungaming
@stormrungaming Жыл бұрын
@@kekuskekus5480 I did this.. but i'm getting the same thing as this guy.. any idea? i'm in 5.2 I changed the visibility
@stormrungaming
@stormrungaming Жыл бұрын
In W_InventorySlot and PreviewMouseButtonDown, the first branch was backwards. I changed the True to go directly to the return node and the false to carry out the function.
@semmert
@semmert Жыл бұрын
This worked for me. Odd.. I wonder why.@@stormrungaming
@NoahBelstad
@NoahBelstad 6 ай бұрын
@@stormrungaming still dosent work for me added a print string right after the start of on mouse prewiev down and it dosent register anything.
@SlombyChannel
@SlombyChannel 11 ай бұрын
I CAN NOT DRAG ANY SLOTS AND I DONT KNOW HOW TO FIX. UNREALENGINE 5.3
@MGamingStudios
@MGamingStudios 2 жыл бұрын
Can you do another tutorial on the JRPG series please 🙏🥺
@Dnf_Jeff
@Dnf_Jeff 7 ай бұрын
Ive done this multiple times and always have a terrible time with handling what widget is in focus, when they are in focus, everything is set to non focusable yet every different UI element i click clearly changes the focus (therfore which key bind overides work. Clicking the open space just breaks everything) I cant reccomend this series through this section. the item data table stuff is great, but this UI aint it. thanks again!
@bighit20100
@bighit20100 2 ай бұрын
bro this is so messy...
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
How To Make Drag And Drop Widget In Unreal Engine 5
15:16
Unreal University
Рет қаралды 7 М.
Drag and drop functio | Survival Game UE5
11:15
Lunar9
Рет қаралды 887
Unreal Engine 5 Tutorial - AI Part 5: Hearing Perception
15:26
Ryan Laley
Рет қаралды 38 М.