Hello, good morning, I’m watching a tutorial and I programmed a function to the play button, I guess the error is due to the assets I downloaded. How can I solve it? Thank you.
using System.Collections;
using System.Collections.Generic;
using UnityEngine.SceneManagement;
using UnityEngine;
public class MainMenu : MonoBehaviour
{
public void PLayGame()
{
SceneManager.LoadSceneAsync(1);
}
}
Hi! Your play button is programmed so that it loads another scene - in this case, the scene with number 1 in the build settings. It looks like that’s not the scene you would like it to load. You can check your build settings for a list of the scenes that are added there (the window screenshotted here) and you’ll probably see a scene with number 1 listed there.
Add the scene that you want to load to that list via drag and drop and change the number in your code to the correct number.
I don’t have scene 1 yet, someone else has it.
Thanks anyway, although I don’t understand why I load those buttons by default, in any case I should have loaded nothing or no object