# touch position

**URL:** <https://discussions.unity.com/t/touch-position/73432>\
**Category:** Questions & Answers\
**Created:** [June 15, 2013, 11:18am UTC](https://discussions.unity.com/t/touch-position/73432 "2013-06-15T11:18:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![awesomeface](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@awesomeface](https://discussions.unity.com/u/awesomeface)\
**Post date:** [June 15, 2013, 11:18am UTC](https://discussions.unity.com/t/touch-position/73432/1 "2013-06-15T11:18:44Z")

</div>

hi, i am quite novice at coding ios/android, anyway, i was hoping someone could tell me how to record the touch position to a variable, hopefully in Vector2 format and in javascript

---

<div class="post-metadata">

**Author:** ![PAHeartBeat](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/paheartbeat/32/263897_2.png) [@PAHeartBeat](https://discussions.unity.com/u/PAHeartBeat)\
**Post date:** [June 15, 2013, 12:32pm UTC](https://discussions.unity.com/t/touch-position/73432/2 "2013-06-15T12:32:01Z")

</div>

you can use Input.touches class for it

```
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

using System;

List touchPositions = new List();
void Update() {
	if(Input.touchCount > 0) {
		touchPositions.Add( Input.touches[0].position)
	}
}

```

you can convert Generic List to Array by using `ToArray()` Method of you List Variable

---

<div class="post-metadata">

**Author:** ![awesomeface](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@awesomeface](https://discussions.unity.com/u/awesomeface)\
**Post date:** [June 16, 2013, 6:05am UTC](https://discussions.unity.com/t/touch-position/73432/3 "2013-06-16T06:05:23Z")

</div>

i don’t understand it completely so could you show me how to do something like this`

```
var pos1X = 0.0;
var pos1Y = 0.0;
var pos2X = 0.0;
var pos2Y = 0.0;

function Update () {
//pos1X = the x value of the first touch if its x value is (> screen.width * 0.5)

//pos1Y = the y value of the first touch

//pos2X = the x value of the second touch

//pos2Y = the y value of the second touch
}

```

`
