Why is my IOS tap function is not working?
I developed my IOS game on a PC and then brought the project over to my Mac, with code that is supposedly correct, but every time I have tried the game on my IPhone the tap is never registered, or something in my Xcode project is incorrect. I have tried twenty different ways to get this little tap function to work with no success. But, when building out the game the console says "Game scripts or other custom code contains OnMouse event handlers. Presence of such handlers might impact performance on handheld devices." Then in Xcode when building it to my IPhone it says that a bunch of things are deprecated(not sure if this issue is related). This is the code that is suppose to take you from the main screen to the first level: using UnityEngine; using System.Collections;
public class TapToPlay : MonoBehaviour {
// Use this for initialization
// Update is called once per frame
void Update () {
if(Input.touchCount == 1)
{
if(Input.GetTouch(0).phase == TouchPhase.Began)
{
Application.LoadLevel("swag");
Time.timeScale = 1;
}
}
}
}
Thanks for your time!
Your answer
Follow this Question
Related Questions
Pressing Vs Jumping 1 Answer
ScreenToWorldPoint on One Axis? 0 Answers
ios app crashes on start 0 Answers
Unity 2d android game How to "freeze" position on Y axis 1 Answer
Is my Touch Algorithm right? 0 Answers