How to add scripts to buttons?

I’m trying to add script to my start text button that whenever i click on the start it moves to another scene which I created named Game but it won’t work. Here’s my code. Feel free to comment if there’s something lacking in my code. Thanks!

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

public class LevelManager : MonoBehaviour
{
public void LoadLevel (string name)
{
Debug.Log (“Level load requested for :” + name);
}
}

I don’t see you calling to load a level.

SceneManager.LoadScene(name);

Should I put it under Debug.Log?

Yes…

I mean, the debug isn’t really needed except for your own purpose…But you’ll need that call there for it to load another scene.

If you are new to scripting, might be helpful to check out some of the tutorials Unity puts out. :slight_smile:

I’m new to this. :smile: Thanks man! Got it already :slight_smile: