- Home /
how to make an unlockable object (Pet) spawn throughout scenes after it gets unlocked?
I got this game where you go through levels(Scenes) collecting coins. I got my menuScene which includes a shop where you can buy a pet for your player, kind of like the pet in among us. Its an AI which follows the payer around.
I need help with spawning the pet into all the following levels(Scenes) after it gets unlocked by the player? I have the pet deactivated throughout the levels and it gets activated by purchasing it (Unlocking it). I'm very new to Unity and have been trying to find a solution for 3 days straight now:( please help me out a hand and thanks in advance!
Answer by HellsHand · Apr 08, 2021 at 08:50 PM
Check the Unity documentation under Scripting API: Object.DontDestroyOnLoad. It has a good description and example of how to use it.