Hi everyone.
Ive been trying to create a game where the player has a list of scenes to go through before ending a run and later starting a new one.
Imagine them as Scene1, Scene2, etc. Which are all part of the build.
The problem I’ve been having is how to:
-
Create Lists with specific scenes (example: DesertScenesList) that Ive previously selected (all desert scenes (Desert1Scene, Desert2Scene, etc )…as an example) to organize gameplay.
-
Add Scenes to a new list (NewRunList), during RunTime, that pulls from the Scenemanager using its methods and adds a specific (or radom) scene to it from those previosuly created lists (DesertScenesList).
-
Loading a scene from the new list (NewRunList)
Any Idea how to do something like this? I understand the Load methods I have to use later but Ive been going back and forth with this for weeks and havent had any breakthoughs.
I’d appreciate any insights you may give me
Thank you
I’m not really sure what you are trying to accomplish, but scenes can be loaded by their name, so you could just have a string list that holds the names of the scenes.
Thank you for the quick reply. Could you provide an example on how to implement it?
What I am trying to accomplish is a game where the player has to go through a list of very short levels (for example) and the way the player solves those levels adds other levels of that same type to the list.
For example:
- A List of 10 levels to accomplish in one run (a game loop that the player will repeat). The NewRunList includes (DesertLevel 1, WaterLevel1, GrassLevel1, etc…)
- The player starts the run (of 10 levels) and one is drawn randomly from NewRunList. The player completes that level and then passes to the next one that is also randomly selected from the levels that have not yet been completed of the NewRunList.
- Everytime a player completes a level (DesertLevel1 for example) based on how many coins (for example) he has collected a new level is added to the NewRunList (DesertLevel2 for example) from a previously created list that includes all of the DesertTypeLevels.
Strings might be an approach but Im still unsure how to implement it.
Which part of:
- string collections
- choosing randomly from a collection
- scene loading
Are you struggling with?? There are literally thousands of tutorials and examples out there for all of these things.
EDIT: is this still the same question from here?! https://discussions.unity.com/t/888633/3
Just put your game gently aside and get familiar with collections… that’s less than an afternoon of learning, not months and months.
Additive scene loading is another possible solution:
https://discussions.unity.com/t/820920/2
https://discussions.unity.com/t/820920/4
https://discussions.unity.com/t/824447/2
A multi-scene loader thingy:
https://pastebin.com/Vecczt5Q
My typical Scene Loader:
https://gist.github.com/kurtdekker/862da3bc22ee13aff61a7606ece6fdd3
Other notes on additive scene loading:
https://discussions.unity.com/t/805654/2
Timing of scene loading:
https://discussions.unity.com/t/813922/2
Also, if something exists only in one scene, DO NOT MAKE A PREFAB out of it. It’s a waste of time and needlessly splits your work between two files, the prefab and the scene, leading to many possible errors and edge cases.
Two similar examples of checking if everything is ready to go:
https://discussions.unity.com/t/840487/10
https://discussions.unity.com/t/851480/4
Dekker.
I have changed how I approached the problem that I posted in the other thread, that is why I decided to open a new one.
I am also learning as I go and thought it best to ask here.
I will check the links you have provided.