iOS touch delay?
Hi,
I'm new to unity, but a veteran in Xcode and 2D games.
I built my first game project in Unity within hours, and compiled it under Xcode to my iPhone 6.
I have 1 touch mechanic in the test game .. if the user is touching the screen.. move the Gameobject upwards, otherwise let gravity pull it down (simple flap bird stuff)
In the simulation I use a space key in the OnGIU() method:
if (Input.GetKey(KeyCode.Space)) { // GetComponent().velocity = new Vector2(speed,0); GetComponent().AddForce(jumpForce); }
in iOS I use touch:
if (Input.touchCount > 0) { rising = true; } else { rising = false; }
where the BOOL 'rising' will add the same jumpForce upwards as the space key in the Update() method.
The problem is when I run the game on the simulation with the space key.. the object moves flawlessly.. however when i build to iOS and run on my phone, there is a delay between any touch event and when unity handles it.
Any quick info for a new timer would be crucial right now,
thanks!
Your answer
Follow this Question
Related Questions
ScreenToWorldPoint on One Axis? 0 Answers
How to replace KeyCode.Space with a simple tap on Android? 1 Answer
Help with touch button (can't call a function) 0 Answers
Rotate object by touch using Angles? 0 Answers
New input system and touch on webgl 1 Answer