I’m currently trying to load a scene once the user clicks the button on the top right hand side of the screen. I’m trying to get it to check if the amount of credits they have is enough and if so, progress to the next scene and if not close the text. I’m a newbie at coding and so need alot of help and laymen terms . please help heres my current code in Java Script: Master is the name of the script that contains the value I want to check.
var Credits: Master;
var float amountCredits;
var offsetX: float = 40;
var offsetY: float = 40;
var sizeX: float = 100;
var sizeY: float = 40;
function Update(){
GameObject.Find("Master");
if (amountCredits.Credits > 15)
Application.LoadLevel ("1");
else
{
GUI.Box (Rect (offsetX, offsetY, sizeX, sizeY),"You have insufficiant credits");
}
}