Search Unity

Android Touch

Discussion in 'Android' started by sophie_louise_k, Dec 5, 2018.

  1. sophie_louise_k

    sophie_louise_k

    Joined:
    Jul 2, 2018
    Posts:
    1
    Hey I'm trying to get my scene to restart on Android, I have it working on a PC but, when I use the Input.GetTouch it doesn't work. But no errors are appearing. Any suggestions. Thanks

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.SceneManagement;

    public class GameOver : MonoBehaviour
    {

    void Update()
    {
    //if (Input.GetKeyDown(KeyCode.R)){

    if (Input.touchCount > 0)
    {
    Touch touch = Input.GetTouch(0);
    SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
    }
    }

    }