Hello! So I am trying to make a Level select screen that isn't UI but made with GameObjects, I have tried making one Game object then small ones as sort of buttons, then assigned a script that reads the following:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class LevelSelect1 : MonoBehaviour
public GameObject button1;
{
// Start is called before the first frame update
void Start()
{
button1.SetActive(false);
}
// Update is called once per frame
void OnMouseDown()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
}
}
(The reason I make it false is because I have another script that activates it before OnMouseDown is done, so that cant be the problem.)