Unreal Engine 4 Inventory Tutorial: Drag and Drop (1)

preview_player
Показать описание
This is the first part of the Unreal Engine 4 (UE4.15) Inventory Drag and Drop tutorial in which I show how to initialize a Drag'n Drop operation with UMG and Blueprints.

The UE4 project is setup as C++ but for this part using blueprints is the better option.

See my social profiles here

Рекомендации по теме
Комментарии
Автор

if anyone is having trouble in 4.18.2 on not detecting drag, use OnPreviewMouseButtonDown instead of OnMouseButtonDown

brosimple
Автор

Awesome! Thanks a lot! Using UE 4.25.1, still works nice (OnPreviewMouseButtonDown needs to be used)

VIN_Wolframwow
Автор

I had problem with it. First thing is what Bro Simple told, change from OnMouseButtonDown to OnPreviewMouseButtonDown . Second thing widget don't need to have button in first place. Without it, drag started working for me.

Hato
Автор

2:49 What type is returned from GetController() function before it gets casted to playerController with type APlayerController*? Just curious because I saw earlier when you first used the Cast, you typed out the code but then the last thing you did was you then said we had to Cast the type so you already knew the type was different and needed to be casted. Like me.. I probably wouldve at first did 'APlayerController* playerController = GetController();' Then I would get an error about it being different types and I would probably then think maybe I need an 'auto' here and then do 'auto playerController = GetController();' just to see if the compiler would know the type for me and somehow make things work but im guessing the compiler would just return type APlayerController* for "auto" and it would still give an error that the types dont match for auto/APlayerController* to that being returned of GetController().. So I instead of thinking of using a Cast I would probably waste time and go and find the type that the function GetController() returns and waste more time trying to figure out what i did wrong before learning I need a "cast" there. lol Is the process I just said done by lots of programmers that they just learn after a while that when youre getting the PlayerController you'll need a cast? I hope it accurate say that with "cast" sometimes its more obvious than other times when you need a "cast" and other times its not so obvious that the types of both objects arent the same type.

vertigo