Unlock levels

Hello…
This is my FIRST thread here…
Can you tell me some tips to write the LEVEL UNLOCKING script…
I have 2 levels 1 2
The level 1 is unlocked (normally), but level 2 is locked…
When I pass the level 1 the level 2 is unlocking and I can pass this level…
The script should have this : When I don’t pass the level 1 I can’t go to the level 2

Sorry my bad English, I’m from Poland

I recommend doing some tutorials, as loading levels and or using variables to set conditions is very basic, and has been covered many times. Please use the search engine to do some research before opening a new topic. Also it helps to post some code that you need help with to show that you are trying to learn, and have gone through the basic scripting tutorials. :slight_smile:

Thank Ingot, but…
This working with GUIButtons?
GUIButton 1 GUIButton Locked (2)

You don’t have to use GUI buttons.
The GUI buttons are a visual representation of what levels are locked and unlocked.

If your looking for a way to determine if the player has unlocked a level you could use the PlayerPrefs to store the current level.

E.G

if( PlayerPrefs.GetInt( "Level" ) > 1 )
{
// They can go to level 2
}

....

 // Completed level 1
PlayerPrefs.SetInt( "Level" )  = 2;

When I left this post, I think, I can do the pictures of the level, when it’s unlocked…

I don’t want to do new thread, well, on the Polish forum somebody tell me idea…
This idea is the game like Desctructiom Derby, well, where I can find the script makes this:
When i fall with the car, this car will destroy or lose HP, but when I fall the game give me a points…