- Home /
Question by
noobakashi · Mar 07, 2012 at 11:47 PM ·
androidtouchdrag
Code compiled to android platform behaves differently.
Hi, I have the following code to fly an airplane.
if(Input.GetMouseButton(0))//tracking mouse drag and rotating the plane accordingly
{
h = horizontalSpeed * Input.GetAxis("Mouse X");
transform.Rotate(0, h, 0);
v = verticalSpeed * Input.GetAxis("Mouse Y");
transform.Rotate(invert * v, 0, 0);
}
transform.Translate(0,0,speed*Time.deltaTime);
It works fine in the unity editor i.e i click and drag for the plane to move but when i compile it for an android device instead of the device changing the direction of the plane on touch and drag it takes absolute touch values and rotates the plane to that.
I came across Touch.DeltaTime but i'm stuck on how to implement it for this. I'd greatly appreciate it if someone could point me in the right direction or some code spinet to fix this.
Thanks in advance. :)
Comment
Your answer
Follow this Question
Related Questions
Android touch and drag GUItexture problem 0 Answers
Finger gesture works/fails on different devices? 0 Answers
Touch deltaPosition Android 1 Answer