if anyone is having trouble in 4.18.2 on not detecting drag, use OnPreviewMouseButtonDown instead of OnMouseButtonDown
@stevebarnes83177 жыл бұрын
Arrgh thank you! Really wish I looked at the comments earlier... just spent 30mins googling. : )
@argons51186 жыл бұрын
thank you dude! helped a lot
@CrysisMachinima6 жыл бұрын
You're a hero, thanks for the heads up!
@strezoiualexandru6 жыл бұрын
Great point, thanks!
@seanomik61766 жыл бұрын
Thank you soooo much!
@Hato19923 жыл бұрын
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.
@Matlik2 жыл бұрын
Your problem solved my problem too. Thanks
@Hato19922 жыл бұрын
@@Matlik That's why I comment this. I'm glad it solved yours problem.
@VIN_Wolframwow4 жыл бұрын
Awesome! Thanks a lot! Using UE 4.25.1, still works nice (OnPreviewMouseButtonDown needs to be used)
@mrmensje13 жыл бұрын
thanks a lot! I'm curious tho if you maybe know too why this is happens or what the difference is between the 2 events? I'd love to learn what I'm doing instead of copying haha :D
@VIN_Wolframwow3 жыл бұрын
@@mrmensje1 I have no idea what is the difference and why the other one doesn't work anymore. I think it is related to some code refactoring but I haven't seen any patch notes related to this
@vertigo69827 жыл бұрын
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.
@JayAnAm7 жыл бұрын
GetController is a method of the framework to return the base class (AController*). To let the compiler know that you want to use the controller that you created (APlayerController) you need to down-cast to this class. Here is an article on OOP that might help: www.codeproject.com/Articles/835135/Object-Oriented-Programming-with-Cplusplus