Hello guys I’m making an unlocking level system for my game.
I want that when the player enters on a onTrigger sets the value to true of l1unlocked.
Here is the script
#pragma strict
var l1unlocked = false;
var unlockedt = Texture2D;
var lockedt = Texture2D;
if (l1unlocked == false)
renderer.material.mainTexture = lockedt;
} else {
renderer.material.mainTexture = unlockedt;
}
function OnMouseUp(){ //only if level is unloked if is locked can't load level
Application.LoadLevel(2);
}
I also want to load the scene only if the level 1 is unlocked.
I need a script that sets the l1unlocked to true using the function OnCollisionEnter and makes the scene loadable.