So I’m having a lot of trouble with the UI Button right now, all I’m trying to do is add a button to change the scene to something else.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class UIManagerScript : MonoBehaviour
{
public void GoTo()
{
Debug.Log ("Clicked");
SceneManager.LoadScene (1);
}
}
I see other people using.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class UIManagerScript : MonoBehaviour
{
public void GoTo()
{
Debug.Log ("Clicked");
Application.loadLevel (1);
}
}
But neither of these ways works.
Also when I try to go into playmode just to see the buttons highlight, nothing happens. It’s like the buttons don’t have a raycast or anything like that. Idk I haven’t used UI elements at all so I have no idea how to use them. If someone could help me that would be greatly appreciated! Thank you