Unity Playmaker - Player Prefs and Locked Level Menu System
In this Unity Playmaker Player Prefs and Locked Level Menu System tutorial, I'll show how you can set up a locked menu system. I'm showing just 3 levels but you can set up as many as you would like. Levels and the menu will show as locked until you have finished the previous level. I will use Pla
This tutorial builds a level-select menu where later levels stay locked until you finish the one before, using Player Prefs to remember progress between sessions. The scene has a level spawn point, a menu with five buttons (covers sit over levels two and three), and prefab levels that spawn at the spawn point. All the logic lives in two FSMs on the Game Manager.
Read saved progress with Player Prefs
Player Prefs are small pieces of data Unity saves to the device — coins, current character, or in this case the highest unlocked level. In the Level Selector FSM, start with a Get Player Prefs Int action set to a count of 1, using the key level num, and store the result in a new global int also called level num. If no value has ever been saved, that's fine — it simply returns the default. Label the state Get Player Prefs and color it for clarity.
Route to the right level with an Int Switch
After fetching the value, transition to a Get Level Number state holding an Int Switch action. Point it at the global level num and add one entry per level: 1 fires a level one event, 2 fires level two, 3 fires level three. Create those three transitions and three matching states. The switch reads saved progress and decides how much of the menu to unlock.
Set prefs and reveal locked levels
In the level one state, write the baseline by using Set Player Prefs Int with key level num and value 1. In the level two state, expose the second button by removing its cover — the tutorial shows two valid approaches: Activate Game Object unchecked to deactivate the cover, or Destroy Object to remove it. Note that destroying only happens at runtime, so the cover still appears in the editor. For level three you need to clear two covers at once, which Destroy Objects (count of 2) handles cleanly.
Advance progress when a level is beaten
Inside each level prefab, the cube already detects the enemy ball, hides itself, and plays a particle burst. Add two more actions there: Set Player Prefs Int to bump level num to the next number (finishing level one sets it to 2), and a Send Event By Name with Broadcast All sending reset level, delayed by 2 seconds so the particle effect can finish playing before the scene changes.
Tear down the level and reopen the menu
On the Level Manager, add a global transition for reset level so it can catch that broadcast from anywhere. In its handler, use Get Child on the level spawn point to find the active level and store its name as current level, then Destroy Object on current level to remove it. Reactivate the menu with Activate Game Object, then finish back to the player-start state so progress is read again. For testing, Unity's Edit > Clear All Player Prefs resets level num to zero, sending you back to the fully locked menu.





