Hello! Total beginner here, so apologies if this is a stupid question. I’ve been trying to work this out for hours, reading everything I can, but it’s driving me crazy!
I have a very simple main menu, that is then supposed to take players into my main game when they press the spacebar. However, for some reason, the game the loads at Level 3, not Level 1.
Why might this be?
Here’s the code I’ve used for my main menu:
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class MenuScript : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetKey(KeyCode.Space))
SceneManager.LoadScene("_Complete-Game" , LoadSceneMode.Single);
SceneManager.UnloadSceneAsync("MainMenu");
}
}
If anybody could please explain what I’ve done wrong, that would be fantastic!
Thanks.