How to continue having a disabled gameobject when the scene loads?
Hello! I am currently creating a game that has two different scenes, that overlap with one another quite a bit. For instance, you go into the store tab, buy a shotgun, go back to the start menu, and then are able to select the shotgun to use in the level you load into. But unless you've purchased the shotgun, it stays locked in the menu, and you aren't able to use it. I've figured out how to keep the guns locked unless you buy them, but I'm having trouble figuring out exactly how to keep them like that. What I mean by this is, every time you switch from, say, the main menu back into the store scene, the weapons become locked again. How would I be able to keep them in a continuous state of being unlocked after the player buys them? I'm not asking for a script of course, but just some pointers- like would this be best accomplished using playerperfs? Or static bools? Thanks for reading this far, and I would greatly appreciate any help!
Forgot to mention! Your ability to buy a gun depends on how much gold you have. So if you have five hundred you can buy the rifle, and if you have 100 you can buy the shotgun. Hope that helps out a bit with this conundrum.
Answer by tormentoarmagedoom · Jun 27, 2018 at 03:37 PM
Good day.
You need to know one of the absics for game developing.
Data persistance, create a information flow between scenes, and more important betweein instances of the game (when you close the game and open it agan).
You must watch and learn what this Unity Persistence - Saving and Loading Data tutorial teach.
Bye
Your answer
Follow this Question
Related Questions
Saving Data (please help) 0 Answers
Card Game Structure 0 Answers
Array index out of range. But it doesn't appear to be. 2 Answers
How to restrict rotation? 0 Answers
Please help me solve the problem with shoot a gun(HTC VIVE) 1 Answer