Hi,
I am creating a 2D Android game and all I’m trying to do is drag an object with my finger, I have the object moving when I move my finger across the screen but it’s inverted, it moves away from my finger, any ideas please?
var speed = 5.0;
function Update () {
if (Input.touches[0].phase == TouchPhase.Moved)
{
var y = Input.touches[-0].deltaPosition.y *speed* Time.deltaTime;
var x = Input.touches[-0].deltaPosition.x *speed* Time.deltaTime;
transform.Translate( new Vector3(x, 0 , y));
}
}