Can't convert mouse position to worldspace with "OnDrop" function in UMG
I'm trying to make a drop and drop material system using UMG. I'm running into an issue when converting the mouse position from screenspace to worldspace when a widget is dropped on the screen. I'm using the results to run a linetrace from the sceen out into the world.
I don't run into this issue when running the conversion on tick, only when using the "OnDrop" function. If I get the mouse position from the player controller, it just returns as 0,0.
If I use the position from the "pointer event" in the function, the direction seems to be wrong, no matter the maths I use, causing the line trace to go out at an unexpected angle.
Here's the function: https://blueprintue.com/blueprint/6z90qytu/ You can see all the different ways I've tried to get the projection to work but I'm having no luck.
Here's the working blueprint from my pawn's event graph: https://blueprintue.com/blueprint/1ep5f89i/ This math doesn't work inside the widget as previously mentioned, the "mouse position" just returns 0,0.
I'd appreciate any guidance on this.
asked Feb 06 '18 at 12:18 PM in Blueprint Scripting
Follow this question
Once you sign in you will be able to subscribe for any updates here