# Createing a touch and drag interface in the 3d world

**URL:** <https://forums.unrealengine.com/t/createing-a-touch-and-drag-interface-in-the-3d-world/341802>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [December 18, 2015, 5:43am UTC](https://forums.unrealengine.com/t/createing-a-touch-and-drag-interface-in-the-3d-world/341802 "2015-12-18T05:43:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_cc63cfed](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_cc63cfed](https://forums.unrealengine.com/u/anonymous_user_cc63cfed)\
**Post date:** [December 18, 2015, 5:43am UTC](https://forums.unrealengine.com/t/createing-a-touch-and-drag-interface-in-the-3d-world/341802/1 "2015-12-18T05:43:55Z")

</div>

I am trying to create a 3d card game for mobile devices. Currently I am in the process of creating an interface to move playing cards through 3d space in the game using a touch screen. When I get the value of the touch input it gives me a 2d vector based on the screen and I can convert that vector to real 3d space. The problem is I had to offset the values I get from the input to match the true location in the game. This presents a problem for multiple sized screens. So far here are the numbers I am working with…

Screen (width / height): 905/431  
Current Offset (width / height): 250/183  
Movement Variance: 22

The movement variance is the number of units the card moves in real 3d for every one unit of touch. I need to find some sort of calculation to scale these values to any screen size but I am stumped. I will add some pictures to help make sense of this.

 ![71121-capture3.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/c/2/9c2dfe5b850d254016b4baa3e85425ffcabe1861.png)

 ![71122-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/c/f/6cfe7fde126de55eb6fbc8db9d54f03ffe1496f5.png)

 ![71123-capture1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/4/e/d4e19f54ad72b7f36fc5fac548a68160c331aab0.png)

I would appreciate any input. Including a better way to use a touch interface all together. I would have imagined an easier to use touch interface system but I guess not. Maybe some way to actually link to 3d space built into the editor. I can get it to work fine on any one specific size but I need a way to scale it no matter what device people play on. If there is no way to scale accurately I guess I can use a table of values but lets try to avoid that…
