I have a button with an Event Trigger with a script attached, but when I touch the button (on a mobile device) it doesn’t work. Is there something wrong with my script, or do I need to add something to the button?
This is my script:`using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TapToStart : MonoBehaviour {
public GameObject homeCanvas;
public GameObject playCanvas;
void Start () {
homeCanvas = GameObject.Find("HomeScreen").GetComponent<GameObject> ();
playCanvas = GameObject.Find("PlayCanvas").GetComponent<GameObject> ();
homeCanvas.SetActive (false);
playCanvas.SetActive (true);
GameObject.Find("Player").GetComponent<PlayerController>().enabled = true;
GameObject.Find("Player").GetComponent<DestroyContact>().enabled = true;
GameObject.Find("GameSpawner").GetComponent<Instantiater>().enabled = true;
}
}
`