Hello all,
I am trying to create a script where i have a gameobject that moves via 2 finger touch on an AR app- across the x axis to change its x value and across the y to change its z. (up and down on the phone screen to go up and down / across to move the object across).
This works fine after the first iteration but is swapped on the first(up and down on the screen moves the object left and right).
It’s like a variable is not being initialised correctly on first iteration.
-this is inside my update method
if (Input.touchCount == 2 && locked == false)
{
Touch touch = Input.GetTouch(0);
obj.transform.position += new Vector3(0.001f * (transform.position.x + touch.deltaPosition.x ), 0.0f,
0.001f *(transform.position.z + touch.deltaPosition.y));
}
Thanks for the help in advance