when i collide with the castle at the end of level 1 i go back to the level map nd the next level should be unlocked but it's not. i have a gameobject in level one that isn't destroyed on a after loading a new level. this script is attached to it:(lvlmaplvlendScript)
static var level = 1;
function OnTriggerEnter(hit : Collider)
{
if(hit.tag == "Levelending")
{
level = 2;
}
}
function Awake()
{
DontDestroyOnLoad(this);
}
basically what it does is when i collide with the castle the variable level becomes 2.
the following script is attached to (on my level map i have to orbs for each level; the gray ones mean level isn't unlocked yet and the yellow ones means they are.(yellows are not active to begin with, they become active through the following script.)) the yellow orb for level two:(level2selectScript)
gameObject.active = false;
if(lvlmaplvlendScript.level == 2)
{
gameObject.active = true;
}
function OnMouseUp()
{
Application.LoadLevel("lvl 2");
}
but the level two yellow orb does not become active after i collide with the castle at the end of level 2.(P.S. I get no errors!)
could someone PLEASE help me with this problem? I been trying to fix this for a long time now and i just couldn't do it. Help with this issue will be GREATLY, AWESOMELY, and EXTREMELY appreciated. Thanks for the help!