I know how to code a script that points you to a scene, for example
MainMenu -
var options=false;
function OnMouseUp()
{
if (options==true)
{
Application.LoadLevel("Options");
//Loads the scene named Options if clicked
}
}
Options -
var mainMenu=false;
function OnMouseUp()
{
if (mainMenu==true)
{
Application.LoadLevel("MainMenu");
//Loads the scene named MainMenu if clicked
}
}
What i currently have for options is a function that will load a certain scene if true.
I don’t want it to point you to a scene if true, i want it to point you to the previous
scene. Can you code something that points you to the previous scene you were in?
Why do i want something like this? for example, if i have a main menu scene with an options button that will load the options scene, and if i have a game level scene that has a menu with an options button that will load the options scene, i can only have the options scene point the player to the game level scene, or the main menu scene. I hope that makes sense!