Nexgea
1
Hi,
I have need touch position, Touch.position dont work.
I dont know why?
#pragma strict
var position: Vector2;
function Start () {
Touch.position = position;
}
function Update () {
}
Error says : An instance of type ‘UnityEngine.Touch’ is required to access non static member ‘position’.
767_2
2
var touch: UnityEngine.Touch;
touch.position = position;
Nexgea
3
Ok so I finnaly make it
i = Input.GetTouch(0).position;
HUGE thanks for 767_2 for helping me !!!
Type this
var position: Vector2;
function Start () {
UnityEngine.Touch touch;
touch.position = position;
}
function Update () {
}
Something like this?
function Update () {
for (var i = 0; i < Input.touchCount; ++i) {
Touch touch = Input.GetTouch(i);
if (touch.phase == TouchPhase.Began) {
if (touch.position > (Screen.width/2)) {
//do something
}
}
}
}