Problems with changing scene via the use of a button
Hey, So I'm totally stumped over my problem. I have written the following code below:
using UnityEngine;
using System.Collections;
public class PlayGameButton : MonoBehaviour
{
public void NextLevelButton(string levelName)
{
Application.LoadLevel(levelName);
}
}
I have created an empty game object and attached my script to it. I have clicked the "+" icon on the button script component and dragged and dropped my empty game object containing my script onto the object box. I have selected the function ButtonNextLevel.NextLevel(string). I then fill in the text scene "MainMenu" which is the name of the scene I want to transition too. And then... nothing happens...
Now I have added it to the build settings and YES it is spelt correctly! :D
An the other thing is that all my buttons work on the main menu screen to transition to controls/instructions/play game etc, but from any other screen... NOPE it does not want to work.
P.S. I do also get this error after building and running the project - http://i.imgur.com/u1tgg7i.png
Your answer
Follow this Question
Related Questions
Draw snapping lines 0 Answers
Question on packages,Вопрос по пакетам 0 Answers
How do i remove an incorrect license. 0 Answers
Model not moving with rig 0 Answers
How do i open PauseMenu with ESC? 0 Answers