Level selection in your Unity game | Unity tutorial
This tutorial/guide will show you how to create level selection in your Unity game. I show you how to design a simple UI to handle that, how to transfer between scenes and finally how to even pass variables to create universal scene.
I'm also preparing for you a second part where you will be able to lock future levels and show stars/points on the existing ones
🎁 Download FREE STARTING Unity project to follow along: www.patreon.com/posts/6687156...
🟠 Support me and download COMPLETED Unity project: www.patreon.com/posts/6687018...
--------------------------------------------------------------------------------
👨💻 SOCIALS:
💜 Join our Discord: / discord
🔵 Follow me on Twitter: / bionicl333
--------------------------------------------------------------------------------
🎓 YOU WILL LEARN:
- How to create level selection in Unity
- How to create multiple levels in your Unity game
- How to design level selection UI (User Interface)
- How to switch between scenes
- How have universal scene
- How to pass variables between scenes
--------------------------------------------------------------------------------
⚙️ VIDEO CHAPTERS:
0:00 - Intro
0:22 - Creating scene
1:33 - Navigating to a different scene
3:42 - Creating levels grid
5:16 - Separate button actions
7:30 - Universal scene
9:31 - Changing scene elements based on the selected level
Пікірлер: 73
I really love your presentation, editing and your explanation. You don't explain too fast or too slow. Just perfect. Thank you so much!
Man, so glad you're back! Didn't even watch the video yet, just wanted to let you know you are awesome and we missed you!
Hello, thanks for coming back and teaching us!
Beyond perfect timing for that video, thank you.
Thank you for making the video and your content was easy to follow and understand! You have earned yourself a new subscriber!
Yeahhh you're back ! Thank you for this work. Hope you do a tutorial about PlayFab Azure Functions one day :]
Welcome back we missed your videos :D
thanks for video It save a lot time , instead of dragging and aligning , grid is brilliant solution
Amazing explanation, amazing editing, amazing video, subbed
very simple and easy but comprehensive video ,i liked it
bro your editing is amazing
we had missed you guys
Top quality editing!
lets go finaly new vid. THX i very like it of your prezentation
Nice and clear instructions, thanks 👍🏻
@CocoCode
Жыл бұрын
Thanks for watching!
Universal scene is good for levels that have the same things and only some little things change, like the background and game difficulty for example, it is good to have it because sometimes you want to change something or add a new idea, if you have multiple levels you will have to go across all levels and do it.
thanks dude, ur video helped alotttt
Code legend is back!
Yaay.. He's back
really helpful tutorial.
you are perfect don't give up
excellent tutorial
Thanks for the nice explanation. What program do you use to edit video?
So awesome! Would love for you to make make new videos on how to unlock levels! Thank you!
@CocoCode
2 жыл бұрын
Thanks 🎉 Actually I have a second part of this video already in the planning stage
@qqq9542
2 жыл бұрын
@@CocoCode No worries! Cant wait for your next video! :)
hi, thank you for video😊 but I have a question, so, will it work in 3d project?
Hi , Thanks for amazing video I have a question, is it possible to implement this feature through Playfab ?
thanks brother
Interesting way to do this. In the script you could also find button as component on awake and add delegate to onclick event. Normally I use some kind of UI manager class that has all the public methods. Idk which one is less messy >< I might try your approach with putting monobehaviour on UI elements
@CocoCode
2 жыл бұрын
In my opinion using OnClick event in the Unity inspector is way clearer approach - you don’t need to dig into the code to find what [this] button is doing, I strongly suggest such option. But fair enough, in this video for example you could automate assigning level values (1,2,3…) to the buttons - it would be a good idea to create a script that at the start cycles though all buttons and assigns correct Id automatically. But that would be just a little bit out of scope of this beginner tutorial
@azgan123
2 жыл бұрын
@@CocoCode Yeah you only need to dig through scene hierarchy now 🤣🤣🤣
@CocoCode
2 жыл бұрын
But if you select button in Unity, you can immediately know what happens after it’s click, otherwise (if not managed properly) you might not know which script changes it’s onClick event
is it possible to be done on an overworld map, like Candy Crush or Super Mario World?
i just want to ask, how to make each level lock until we finish the 1st level
Thank you so much
Do you use Premier pro for editing?
Hi everything one Tried to use Animator as show in Coco vidéo but it bug with my last Unity version. Has anyone à solution ? Thank’s
How can I make all the buttons interactable
great vid
Thanks a lot. But how does a game like candy crush handels more than 10.000 levels?
great videos! maybe could you make new tutorial about fisher yates shuffle on unity quiz? thank you..
thank you
ty
hi, can I request a tutorial for the levels that could be only unlocked once the player finished the first stage
@aarondelgado3421
Жыл бұрын
You probably can create variables to save when the game is initialized for the first time such as level2locked = true. Then if the player finishes the first stage, the game can update that saved variable to: level2locked = false and when the load selection scene is loaded it will check for that variable and if it has changed, it will use the logic you have programmed to remove the lock image, etc.
@martinpolajner9080
Жыл бұрын
@@aarondelgado3421thats a good idea i did something similar only onstead of making a bunch of bool IsLocked levels you can save one int for levelUnlocked and all levels lower to that are unlocked in a loop on awake
@baldchessman
Жыл бұрын
You can have an array of bools called canEnter for example and an array of levels called levels ,and then before loading a level ,check if canEnter[the level's index] is true
the button "back to level selection" doesnt appear to me
So for the universal scene it works by changing background and sprites but if your levels have enemies switches etc. it means you would have to move it in by this script?
@CocoCode
Жыл бұрын
That is correct! If your game is based on designed levels (e.g. you need to place elements in a Unity editor), multiple scenes approach may be better. But if your game is highly script-logic based and everything is generated using script, it may be more convenient to have everything in one scene
best vidio ever
idk why but my scene just pauses when it loads
im frustrated that the thumbnail includes the highlighted level icon growing in size but you didn't talk about how to make that happen in the video (thats what im looking for specifically how to do)
@CocoCode
Жыл бұрын
Hey! 👋 Please check out this older video of mine that covers button animations: kzread.info/dash/bejne/lYthp5aQddLNqqg.html
but it doesn't work if your using worlds 1 - 3 would only display 1-1
@samirflima
Жыл бұрын
have you found a way to do it?
How to lock
🙌
i didn't understand why he used universal scene
😃
500 like from me
Maciek, czemu nie robisz filmów po polsku?
are you Great Scot??
Superficially
Pls Bro Scripts
I'm the 69th liker.
Everything looked beautiful Until the button was created
@CocoCode
2 жыл бұрын
Why? 😅
@DivSharp
2 жыл бұрын
@@CocoCode Obviously, The default unity button looked ugly before you edited it 0:46