Get Touch Pos In Widget [UMG]

Have you tried overriding OnTouchStarted and Getting Screen Space Position?

Hello everyone! Ive got a problem with trying to get Touch position in UMG widget.
Once I tried to use node Get Mouse Position on Viewport (its work fine to me in editor), but its doesn’t work on Mobile with touch (return 0, 0 pos).
Maybe any ideas how get Touch position inside UMG?

Sorry, I had mistake on title. That about get touch pos. in widget
So, if I has widget 1440x2560 & viewport 540x960 I want to get values that fit to widget size (like do node Get Mouse Position on Viewport, values in range of 1440x2560)

I tried to use Get Screen Pos. & its return viewport values (in range 540x960)

Thanks! That work for me

Sounds like you want local size but I’m not sure:

There’s a couple more absolute nodes, experiment with those if the above does not get you what you need.

1 Like

Awesome, good luck with the rest!

Hello. I found the answer to this question. The system works without fail regardless of (Anchors) or (Screen Size).You need to insert instead of (Get mouse position) to (Get touch position). Hope I could help you !!!

2 Likes

get touch position does not exist…

Hello, here is my solution. Ineed to click at button on 3D menu widget on mobile (android)

I perhaps it’s will help for some one

Thanks,
This works for me.

By overriding OnTouchStarted, OnTouchEnded, and the OnTouchMoved functions in a UMG widget, I can use these nodes to process my touches. This is very helpful since the documentation on converting these pointer inputs is unclear. Also, this method will work with multi-touch, unlike the GetMousePosition method.