Having problems to tap on button on IOS Unity game

Viewed 128

I started to work on my first mobile game in Unity. For now, the game I am working is Pong. The problem that I am having is that I want to create the pause and resume buttons but whenever I create and tap on them, nothing happens.

This is the created button: enter image description here

This is my canvas: enter image description here

This is the event system: enter image description here

This is the code I use for my button. It works fine when I clic it but not when I tap it:

 private void pause() { 
        Time.timeScale = 0f;
    }

    private void resume()
    {
        Time.timeScale = 1f;

    }

    public void pauseResume() {
        if (!paused)
        {
                pause();
                paused = true;
        }
        else {
            if (paused)
            {
                    resume();
                    paused = false;
            }

        }
    }

I tried using Event triggers but it does not work so my theory is that the problem is not in the way I create the buttons or the way the resume pause method is coded. Something is blocking me of using the button in my device (Iphone 8).

0 Answers
Related