Custom mouse not set to mouse position blueprint

I want to set the position of my custom cursor(a widget in the umg) to the mouse cursor and what I’ve got is pretty strange…there is an offset between my cursor and the mouse cursor…and with moving it the offset is going to change…
I am using event tick for the umg blueprint.

what can I do to resolve this probelm?
thanks in advance

In most cases, the mouse position is based off of Screenspace not viewport/widget space. So if you have your viewport not anchored to your top left corner of your monitor, you will get offsets. I believe you even have offsets unless you go borderless.

You need to add the viewport/widget offset to your calculations. You can use the node “GetScreenSpacePosition”

Hope that helps =)

thanks i’ll give it a try

sorry i’ve been working on another project…now I came back to this project…how to use GetScreenSpacePosition? and where?

thanks

now it works thanks

I’ve got another problem and the problem is that i set to not show the default mouse cursor but after showing the new umg and every time i click the button that cursor shows up…how to solve it?

Just do a verification of a getPlayerCotroller → SetMouseCursor when the butto is clicked or whatever script is giving you problems.