# What is the best way to find where Touch Controls are being pressed?

**URL:** <https://forums.unrealengine.com/t/what-is-the-best-way-to-find-where-touch-controls-are-being-pressed/435301>\
**Category:** Blueprint\
**Tags:** touch-interface, unreal-engine, touch, question, Blueprint\
**Created:** [October 9, 2018, 5:33am UTC](https://forums.unrealengine.com/t/what-is-the-best-way-to-find-where-touch-controls-are-being-pressed/435301 "2018-10-09T05:33:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mattxm](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mattxm](https://forums.unrealengine.com/u/Mattxm)\
**Post date:** [October 9, 2018, 5:33am UTC](https://forums.unrealengine.com/t/what-is-the-best-way-to-find-where-touch-controls-are-being-pressed/435301/1 "2018-10-09T05:33:36Z")

</div>

I need to see where on the screen the user is holding down with their finger and if is within certain regions of the screen. I thought about using widgets and just making them invisible, but that seems like a bad idea since it can effect other UI or click-through stuff later on. Is there a good way of finding regions that can either adapt to screen size or something else entirely?

I’m new to working with touch controls so I kind of want to do it right. Here is a 30 second ms paint visual of what I’m saying if it isn’t that clear.

![256052-touch.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/f/d/afd47bcb645f5014f9803b96f4261f5af00fd14b.png)

---

<div class="post-metadata">

**Author:** ![mightyenigma](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mightyenigma](https://forums.unrealengine.com/u/mightyenigma)\
**Post date:** [October 9, 2018, 3:17pm UTC](https://forums.unrealengine.com/t/what-is-the-best-way-to-find-where-touch-controls-are-being-pressed/435301/2 "2018-10-09T15:17:55Z")

</div>

The Tick event and a few others in UMG contain a pin called Geometry, which lets you convert between coordinate systems. Touch coordinates are different from UMG coordinates, and I think screen coordinates are not necessarily the same as touch coordinates too!

So to overcome this problem I use that Geometry pin and the Local to Viewport node which takes a Vector2D coordinate pair, the geometry wire, and then outputs two options: Pixel coords or viewport coords.

I think to solve my problem (but not sure) I had to grab the Touch’s pixel coords and then feed those into a second Local to Viewport node to convert into UMG coords. Sorry I don’t have the blueprint handy but I was able to get a UMG button to follow my touch around the screen this way.

Geometry wire is also the best way to get the size of the viewport (it has a node for that) if you’re trying to match up the touch with it or the relative positioning of UMG elements on the canvas. Anything else I tried miscalculated things like where the edges and middle are.
