Тёмный

Create LEVEL MENU in Unity: UI Design & Level Locking/Unlocking System! 

Rehope Games
Подписаться 10 тыс.
Просмотров 53 тыс.
50% 1

Discover the secrets of creating a stunning Level Menu in Unity with this easy-to-follow tutorial! Boost your Unity skills by learning how to design a beautiful User Interface (UI) for your level selection, and implement an intuitive Level Locking & Unlocking System. This video is perfect for Unity developers eager to improve their games' menus and user experience. Let's dive in! 👇
🌟 Video Highlights 🌟
Create an eye-catching Level Menu UI in Unity 🎨
Design a simple yet effective level selection screen 🖱
Implement a level locking/unlocking system to keep players engaged 🔒
Tips and tricks to enhance your Unity game's overall look and feel 🕹
Don't forget to Like, Comment, and Subscribe for more Unity tutorials, tips, and tricks!💡
Enjoy the video ☕
#UnityTutorial #LevelMenu #GameDevelopment

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 183   
@kevinstevelmans4568
@kevinstevelmans4568 Год назад
Hello there! First of all, awesome video. This tutorial helped a lot and made some things really clear. However I may have an easy addition to your level selector menu. Instead of making a separate UI sprite image for each number you could only use the background as image and use the text within the button. The text will be displayed on top of the image making it the same and for my opinion a little bit easier to add a new button or edit the contents. You can even add a custom font to your game that you can use for your buttons. So I am not sure if you did it on purpose to use a separate image for every button but I think this will help a bit to reduce some size of the game and reuse your sprites. This is just a tip/add-on to your tutorial, not meaning any harm with it :) I am glad that I came across your video tho. It really helped me a lot, keep up the great work!
@RehopeGames
@RehopeGames Год назад
Hi 🖐 - I agree with your opinion. Using a single background is ideal for both practicality and size optimization. - I created one button in Adobe Illustrator and gave them different numbers, then export. - But in real game it makes sense to do as you say (if all buttons will be in the same design) Thank you so much for your nice comment 🙏😊
@MuhammadIshaq-px9cf
@MuhammadIshaq-px9cf Год назад
sir you explain to simple way
@salmadiaaelabsi
@salmadiaaelabsi Год назад
Thank you so much for this video, it helped me a lot in my internship project! I have a question though, how do I reset the game to lock all levels again?
@RehopeGames
@RehopeGames Год назад
Hi, public void ResetGame() { PlayerPrefs.DeleteAll(); } Connect this method any button as click event. And thanks for your nice feedback :)
@salmadiaaelabsi
@salmadiaaelabsi Год назад
Thank you loads, you are awesome!! @@RehopeGames
@RehopeGames
@RehopeGames Год назад
@@salmadiaaelabsi You're welcome. Thank you very much for your courtesy.😊
@antos1812
@antos1812 9 месяцев назад
Hey I have a problem unlocking further levels, I watched your video and followed your every step, no errors are displayed to me, agdy I complete level 1 or 2 etc. the only level I can play is this further level 1 does not unlock at all. Please Respond.
@storm_pegasus9659
@storm_pegasus9659 Месяц назад
You find the solution???
@harryking4700
@harryking4700 11 месяцев назад
Assests?
@RehopeGames
@RehopeGames 11 месяцев назад
Coming soon ...
@firmansyahpratamaaji5899
@firmansyahpratamaaji5899 Месяц назад
Hello sir, i ihave problem in unity, IndexOutofrangeException: Index was outside the bounds of the array
@tronal9113
@tronal9113 Год назад
hey Rehope i have a problem when i play the game and open the next level the the level does not unlock in the level selector how can i fix this plz
@RehopeGames
@RehopeGames Год назад
Hi , did you follow me step by step. Can you show me your script ?
@tronal9113
@tronal9113 Год назад
using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class levelMenu : MonoBehaviour { public Button[] buttons; public GameObject levelButtons; private void Awake() { ButtonsToArray(); int unLockedlevel = PlayerPrefs.GetInt("UnLockedLevel", 1); for (int i = 0; i < buttons.Length; i++) { buttons[i].interactable = false; } for (int i = 0;i < unLockedlevel; i++) { buttons[i].interactable = true; } } public void OpenLevel(int levelId) { string levelName = "Level " + levelId; SceneManager.LoadScene(levelName); } void ButtonsToArray() { int childCount = levelButtons.transform.childCount; buttons = new Button[childCount]; for (int i = 0; i < childCount; i++) { buttons[i] = levelButtons.transform.GetChild(i).gameObject.GetComponent(); } } } ................................................................................. using UnityEngine; using UnityEngine.SceneManagement; public class FinishPoint : MonoBehaviour { public GameObject levelCompleted; private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { UnLockNewLevel(); SceneController.instance.NextLevel(); levelCompleted.SetActive(true); } } void UnLockNewLevel() { if (SceneManager.GetActiveScene().buildIndex >= PlayerPrefs.GetInt("ReachedIndex")) { PlayerPrefs.SetInt("ReachedIndex", SceneManager.GetActiveScene().buildIndex + 1); PlayerPrefs.SetInt("UnLockedLevel", PlayerPrefs.GetInt("UnLockedLevel", 1) + 1); PlayerPrefs.Save(); } } }@@RehopeGames
@tronal9113
@tronal9113 Год назад
i ifollwed you step by step but check my code if there is something wrong and thank you for your help @@RehopeGames
@tronal9113
@tronal9113 Год назад
Hey did u check my code @@RehopeGames
@tronal9113
@tronal9113 Год назад
hey can you check my code plz@@RehopeGames
@deanl675
@deanl675 5 месяцев назад
Thank you for your easy to understand tutorial!!! It really helped me a lot. ( * u * )
@Creator_Max_dev
@Creator_Max_dev Год назад
Thanks Brother You Are The claimant of 100k sub
@RehopeGames
@RehopeGames Год назад
Thank you so much bro 😊
@id-issa
@id-issa Месяц назад
thanks alot man 🙏
@RebaalSiddique
@RebaalSiddique Месяц назад
@Rehope Games from where did u get the assests?
@Y_can_D
@Y_can_D 9 месяцев назад
Hello i have a problem when i press the level 1 button the unity says level 11 not in build in and when i press level 2 button it says 12 what can i do?
@goldenapple801
@goldenapple801 6 месяцев назад
Look in the script, you have a "1" somewhere
@vik3111
@vik3111 Год назад
I have a request for you. I'd like you to add the ability to close the menu with the B button to close the menu and the LB & RB triggers for the tab system with a gamepad.
@RehopeGames
@RehopeGames Год назад
Hello , you can do it using New Input System
@WizardFerret-it6jd
@WizardFerret-it6jd Год назад
Hi nice Tutorial but in the LevelScript i have the error Assets\LevelMenu.cs(8,12): error CS0246: The type or namespace name 'Button' could not be found (are you missing a using directive or an assembly reference?)
@RehopeGames
@RehopeGames Год назад
Did you drag and drop the level buttons to the Button slots (Button[] array variable) on Unity ?
@aleksandraaleksandra7934
@aleksandraaleksandra7934 Год назад
Hi, great tutorial! I do everything step by step and it works until unlock levels, then it just stays the same: in the level select menu, I can click on each one. I checked the scripts, canvas etc but I don't see any error anywhere. Does anyone have an idea what could be wrong?
@RehopeGames
@RehopeGames Год назад
Were all the levels unlocked when you first made them, or are they all unlocked after you complete the levels?
@aleksandraaleksandra7934
@aleksandraaleksandra7934 Год назад
@@RehopeGames they are unlocked all the time 😔 before and after I play the game
@bobbyhobs8669
@bobbyhobs8669 Год назад
I am also experiencing this issue. Triple checked the scripts and everything in editor and can’t find where the break is…
@amirulkmpk9344
@amirulkmpk9344 9 месяцев назад
hello, hopefully you can answer my question. If i want to change the condition of the coding (when the level is complete) from box collider to just a button? Is it possible?
@RehopeGames
@RehopeGames 9 месяцев назад
Hello, Of course it's possible bro 😉
@Darales
@Darales Месяц назад
thanks man , I almost delete unity
@gabmanong6948
@gabmanong6948 10 месяцев назад
hi i appreciated the video, it helps so much me on my project. But how do you reset the buttons? I mean how will the buttons be locked again? when you stop playing it? i hope i can get an answers, thank you so much sir.
@RehopeGames
@RehopeGames 10 месяцев назад
Hello, You can Delete the PlayerPrefs Data ( Contain Level Progress) to Reset the game. Thanks 🙏
@dastanahmad3887
@dastanahmad3887 9 месяцев назад
Thank you so much for the video. It was a big help for me😁
@RehopeGames
@RehopeGames 9 месяцев назад
I'm so glad! 😊
@-alaerab
@-alaerab 11 месяцев назад
IndexOutOfRangeException: Index was outside the bounds of the array. LevelMenu.Awake () (at Assets/script/script menu level/LevelMenu.cs:22) UnityEngine.EventSystems.EventSystem:Update() (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:398)
@RehopeGames
@RehopeGames 11 месяцев назад
🤦‍♂️
@berks2971
@berks2971 5 месяцев назад
For me its not unlocking the levels
@wickedgamer1082
@wickedgamer1082 11 месяцев назад
I was Struggling to get this to work at first, then I looked at my console and noticed "the submit button is not setup" I changed it from "Submit" to Fire1 and it worked for me after that
@RehopeGames
@RehopeGames 11 месяцев назад
Nice 👍
@psunami
@psunami Год назад
"The name 'SceneController' does not exist in the current context" How do I fix this?
@RehopeGames
@RehopeGames Год назад
You should create a SceneController script. I've created it in this video ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-E25JWfeCFPA.html
@aradjalilian
@aradjalilian 9 месяцев назад
Çok teşekkürler arkadaşım projemde bana yardımcı oldu, farklı tıklama etkinlikleri yapmanızı ve bunları seviyelerine eklemenizi öneririm
@RehopeGames
@RehopeGames 9 месяцев назад
İşine yaramasına sevindim, güzel geri bildirimin için teşekkürler kardeşim parmaklarına sağlık 😊
@aradjalilian
@aradjalilian 9 месяцев назад
@@RehopeGames evet çünkü oyun projesi için bir video yapmamız gerekiyor
@PerEffect0
@PerEffect0 9 месяцев назад
as you can see
@RehopeGames
@RehopeGames 9 месяцев назад
😅
@TigranPetrosyanS
@TigranPetrosyanS 7 месяцев назад
Hi, thanks for video, can you help me with one question. I want to make this menu for 2.5D and 3D game, but i can't understand from video, if i add finish point to a box collider in 2.5D game, will it work or not ? if not, can you please help how to do that, when in 2.5D game player enter collider, start next level ? As i understand save will work with 2.5D without any problem. is this true code for that ? using UnityEngine; using UnityEngine.SceneManagement; public class FinishPoint : MonoBehaviour { private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { UnlockNewLevel(); SceneController.instance.NextLevel(); } } void UnlockNewLevel() { if (SceneManager.GetActiveScene().buildIndex >= PlayerPrefs.GetInt("ReachedIndex")) { PlayerPrefs.SetInt("ReachedIndex", SceneManager.GetActiveScene().buildIndex + 1); PlayerPrefs.SetInt("UnlockedLevel", PlayerPrefs.GetInt("UnlockedLevel") + 1); // Fixed the line PlayerPrefs.Save(); } } }
@hursiticke9018
@hursiticke9018 4 месяца назад
Anlatımın için çok teşekkürler.Benim bir sorum olacaktı.Kilidi açılan bölümleri tekrar nasıl kitleyebilirim
@PrzolThapa
@PrzolThapa 3 месяца назад
please provide asset links too
@helloeveryone-q8z
@helloeveryone-q8z 10 месяцев назад
Hello, When I try to use the buttons multiple times in one play test i sometimes get an error saying Invalid scene name (empty string) and invalid build index -1. The code works but when it gives me that error the correct scene doesn't load and either reloads the current scene or loads a random scene. How can I fix this?
@RehopeGames
@RehopeGames 10 месяцев назад
Hello , Did you add all scenes to the Build Settings panel? Check the scene name (You called as Parameter)
@immersivearvr7148
@immersivearvr7148 10 месяцев назад
@@RehopeGames , Unity Unite... Unity code.
@denied2182
@denied2182 4 месяца назад
Hi, I was wondering how would I be able to implement this if instead it was like a button what they had to buy to then unlock a higher level ?
@AdnanZamanGames1234
@AdnanZamanGames1234 5 месяцев назад
After building my project and doesnt work anymore i matched yours me same pls help i contacted unity techonologies but they said to say to the owner of scripts
@nishahasan3334
@nishahasan3334 11 месяцев назад
Thank you so much for the video. Can you also make a video on setting up a level map with theme changing and all, where a player or a trail will follow when we reach to next level as it can be seen in many games? Thank you!
@RehopeGames
@RehopeGames 11 месяцев назад
I've noted your request . Thanks for your feedback 😊🙏
@shivc03
@shivc03 Год назад
Thank You worked well. the only thing i changed was instead of making two for loops I did this int unlocklevel = PlayerPrefs.GetInt("unlockedlevel", 1); for(int i = 0; i < buttons.Length; i++) { if(i + 1 > unlocklevel) { buttons[i].interactable = false; } I would get the Index error but this seems to work, but overall good video
@RehopeGames
@RehopeGames Год назад
👍
@AdnanZamanGames1234
@AdnanZamanGames1234 5 месяцев назад
i didnt add buttonstoarray
@ariygt
@ariygt Год назад
thank you for this awesome tutorial! it helped me so much!
@RehopeGames
@RehopeGames Год назад
I'm glad it helped you , Thanks for your nice feedback 😊
@seffafadam287
@seffafadam287 5 месяцев назад
aga ikinizde türksünüz niye ingilizce konuşuyonuz
@ariygt
@ariygt 5 месяцев назад
@@seffafadam287 ben iyi yorum olsun da öne çıksın kanalı diye yazdım işime de yaramıştı ödevimde
@fesr9974
@fesr9974 Год назад
Even though I'm from Russia, but I'm watching you. You're the best!
@RehopeGames
@RehopeGames Год назад
Thank you very much for your motivational feedback🙏 I wish you success in your project.😊
@pawanrajen
@pawanrajen Месяц назад
Thank you
@Shiva_04
@Shiva_04 7 месяцев назад
Your videos in recent times do helped me a lot But The one area that haven't helped is the part where the unlocked levels been evaluated i got an NullReference Exception : Object reference not set to an instqnce of an object 😢
@tvasti535
@tvasti535 2 месяца назад
tnx ...
@hocineache7033
@hocineache7033 11 месяцев назад
can you please add player skin selection to the game please?
@RehopeGames
@RehopeGames 11 месяцев назад
Nice idea 👌 I've noted your request . Thanks 🙏😊
@tuanvietnguyen734
@tuanvietnguyen734 Год назад
Can you make Pause Menu and pause game system, that's would be great!
@RehopeGames
@RehopeGames Год назад
Ok , The next video will be about Pause Menu/System 👍 See you in the next video 😊
@AdnanZamanGames1234
@AdnanZamanGames1234 6 месяцев назад
We died😂
@RehopeGames
@RehopeGames 5 месяцев назад
😂😂
@AdnanZamanGames1234
@AdnanZamanGames1234 5 месяцев назад
@@RehopeGames OMG
@abiodunfatoyinbo3214
@abiodunfatoyinbo3214 10 месяцев назад
Please can you do a tutorial on unity ads pleasessssssss
@RehopeGames
@RehopeGames 10 месяцев назад
I've noted your request thanks 🙏
@lifestylebyalfi5854
@lifestylebyalfi5854 6 месяцев назад
Easiest I've Ever Seen Thanks❤
@missoo7128
@missoo7128 9 месяцев назад
great tutorial! Thank you💗
@RehopeGames
@RehopeGames 8 месяцев назад
Thank you so much ❤🙏
@santhoshu6768
@santhoshu6768 3 месяца назад
How do I lock every levels again
@taolatu8506
@taolatu8506 2 месяца назад
void Update() { if(Input.GetKeyDown(KeyCode.M)) { PlayerPrefs.DeleteAll(); Debug.Log("PlayerPrefs Deleted"); } }
@OmPrakash-pr3yp
@OmPrakash-pr3yp Год назад
Thank you again but can you please give me all the assets? I you have them?
@RehopeGames
@RehopeGames Год назад
Hello, I'm gonna publish all project to itch.io in this week and I will share download link
@farahimann
@farahimann 10 месяцев назад
⁠@@RehopeGamesHello can i have the download link 🥹
@seffafadam287
@seffafadam287 5 месяцев назад
Abi eline sağlık video çok işime yaradı
@vijayola7597
@vijayola7597 Год назад
nice video !
@RehopeGames
@RehopeGames Год назад
Thanks! 🙏😊
@NikolayAvanesyan-j5l
@NikolayAvanesyan-j5l 6 месяцев назад
Thank you so mutch
@nevertoomanycats5159
@nevertoomanycats5159 11 месяцев назад
Hi um when I press a button a different button near it gets pressed instead, I don't know if buttons have Rigibodys and there covering each other I don't know but I desperately need anyones help so please if you know what's causing this just leave a comment... thank you
@RehopeGames
@RehopeGames 10 месяцев назад
Hello, I hope you solved the problem. If not , Check the Rect size of the buttons. Thanks 🙏
@nomisnibor
@nomisnibor 7 месяцев назад
Amazing, thank you so much!
@nomisnibor
@nomisnibor 7 месяцев назад
I am facing some issue with a restart button. Like the advices you gave to one of this comment. If you could make a short video about it. It would be fantastic. 😋
@erenbektas627
@erenbektas627 9 месяцев назад
tu es le KING. 🤩🤩🤩🤩
@Director414
@Director414 3 месяца назад
Great tutorial,any thanks for sharing this! 😊
@Unity_Tutorial_Games
@Unity_Tutorial_Games Год назад
good
@RehopeGames
@RehopeGames Год назад
Thanks 😊
@ola8189
@ola8189 10 месяцев назад
hello! thankyou for this video. i would like to ask something. because my levels dont have an "end" to them, I cant use your exact method. i want levels to unlock when the previous one reaches a certain score. for example, level 2 only unlocks when level 1 highscore is 100. and level 3 unlocks when level 2 highscore is 100. how would i do this?
@RehopeGames
@RehopeGames 10 месяцев назад
Hello! Yes, you can do this with a simple algorithm. First, you set the required high score for each level. Then, each time the player's score changes, you check whether they have surpassed the required high score for the current level, using a conditional statement. If they have exceeded the required high score, you call the necessary function to unlock the next level.
@ola8189
@ola8189 10 месяцев назад
@@RehopeGames thank you so much! would it be possible if you could give me some example simple code I could use to start off? Sorry, I am quite new to coding haha
@aynsjc
@aynsjc 4 месяца назад
Bro is underrated, you are so good bro, the next Brackeys!
@zhafranalvinsyah4538
@zhafranalvinsyah4538 10 месяцев назад
i alr used unity.ui namespace, why cant use interactable on button? Assets\Script\UI\LevelScene.cs(23,27): error CS1061: 'Button' does not contain a definition for 'interactable' and no accessible extension method 'interactable' accepting a first argument of type 'Button' could be found (are you missing a using directive or an assembly reference?)
@zhafranalvinsyah4538
@zhafranalvinsyah4538 10 месяцев назад
and i also cant drag n drop or references the object level from levels panel on inspector
@RehopeGames
@RehopeGames 10 месяцев назад
Did you follow me step by step?
@goldenapple801
@goldenapple801 6 месяцев назад
I have the same issue. @@RehopeGames This is my code using UnityEngine; using System.Collections; using System.Collections.Generic; using UnityEngine.SceneManagement; using UnityEngine.UI; public class LevelMenu : MonoBehaviour { public Button[] buttons; public void Awake() { int unlockedLevel = PlayerPrefs.GetInt("Unlockedlevel", 1); for (int i = 0; i < buttons.Length; i++) { buttons[i].enabled = false; } for (int i = 0; i < unlockedLevel; i++) { buttons[i].enabled = true; } } public void OpenLevel(int levelId) { string levelName = "Level " + levelId; SceneManager.LoadScene(levelName); } }
@aleksandraaleksandra7934
@aleksandraaleksandra7934 Год назад
I did everything as you did, but levels 1-5 are unlocked (6:53). I have 8 levels and only the last three are locked. What am I doing wrong?
@RehopeGames
@RehopeGames Год назад
Hi , can you show me your script?
@aleksandraaleksandra7934
@aleksandraaleksandra7934 Год назад
@@RehopeGames using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class LevelMenu : MonoBehaviour { public Button[] buttons; private void Awake() { int unlockedLevel = PlayerPrefs.GetInt("UnlockedLevel",1); for (int i =0; i < buttons.Length; i++) { buttons[i].interactable = false; } for (int i =0; i < unlockedLevel; i++) { buttons[i].interactable = true; } } public void OpenLevel(int levelId) { string levelName = "Level" + levelId; SceneManager.LoadScene(levelName); } }
@adellardorashdan3721
@adellardorashdan3721 7 месяцев назад
I try to implement it to unity visual scripting and it works perfectly! thank you so much
@abdulmlaikalomayri727
@abdulmlaikalomayri727 4 месяца назад
Thank you Rehope Games.
@John-1904
@John-1904 11 месяцев назад
thanks
@RehopeGames
@RehopeGames 11 месяцев назад
Thanks 🙏
@GEMAGEMA-xr3rp
@GEMAGEMA-xr3rp Год назад
Thank you for a great video
@RehopeGames
@RehopeGames Год назад
I glad to hear that , thank you so much bro 😊
@CodenTheSynth
@CodenTheSynth 11 месяцев назад
I thought that this whould be harder but it's suprisingly easy... Thanks!! But there is one problem. If i want to test my game wich will have a lot of levels, is there a way to clear all of the data from unlocking levels?
@RehopeGames
@RehopeGames 10 месяцев назад
Yes of course, İf you will keep the progress data in local ( client side ) you can store the data as json file. (don't forget to encrypt the json file ) Create Default Player Data and change the Player Data when you wanna reset the game. This topic is actually detally, maybe I can share a video about that.
@immersivearvr7148
@immersivearvr7148 10 месяцев назад
the Next Level, complete Unity reg
@CodenTheSynth
@CodenTheSynth 10 месяцев назад
@@RehopeGames just started doing the tutorial, after finishing i noticed that progressing does not work! ive tried removing some non-level scenes but it still doesnt work :(
@achmadajiepriyajie5834
@achmadajiepriyajie5834 Год назад
thanks bro you help a lot
@RehopeGames
@RehopeGames Год назад
Thank you so much bro for your nice feedback 😊
@Rccustomoffroad
@Rccustomoffroad Год назад
Hello, sir, i have a problem, after i finish second level, he don t unlock third level, even if it load and finish ...😢
@RehopeGames
@RehopeGames Год назад
Check the your script
@Rccustomoffroad
@Rccustomoffroad Год назад
I will check, thanx
@projectsafesafe8545
@projectsafesafe8545 Год назад
nice buddy
@RehopeGames
@RehopeGames Год назад
Thanks ✌
@angrypuppy
@angrypuppy 10 месяцев назад
i keep getting an error code that says its not in build settings but it is. why is it doing this?
@RehopeGames
@RehopeGames 10 месяцев назад
You probably forgot to add the game scenes to the build settings panel.
@angrypuppy
@angrypuppy 10 месяцев назад
I got it working thanks tho
@RehopeGames
@RehopeGames 10 месяцев назад
@@angrypuppy 👍
@OmPrakash-pr3yp
@OmPrakash-pr3yp Год назад
Thank you
@RehopeGames
@RehopeGames Год назад
Thanks 😊
@opmistakarmy
@opmistakarmy 9 месяцев назад
Hii bro can you Send me link of your Menu UI sprites😭😭😭
@RehopeGames
@RehopeGames 8 месяцев назад
Hi bro , I will share the all project soon .
@opmistakarmy
@opmistakarmy 8 месяцев назад
@@RehopeGames bro It's urgent I build my game without menu plz provide me sprties now
@spooky_141
@spooky_141 Год назад
guys i can't use scenecotroller and what can i do
@RehopeGames
@RehopeGames Год назад
this video for you bro 😀 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-E25JWfeCFPA.html
@NightFoxZero
@NightFoxZero Год назад
Oh my gosh, FINALLY a nice and simple way to do level select/unlock. I've looked through videos over a long time but none of them would work fully or be too complex to implement with my project. I'm like " I should be able to just increment an integer to unlock the next level" but couldn't figure it out myself. Absolute god-send of a video
@RehopeGames
@RehopeGames Год назад
I'm glad the video helped you 😊 Thanks for nice feedback 🙏
@benjaminbailey4390
@benjaminbailey4390 11 месяцев назад
Hi, it only lets me unlock level 2 when ive completed level 2 not level 1. How do i fix it?
@RehopeGames
@RehopeGames 11 месяцев назад
Hi, I hope you solved it. If not can you show me your script
@TheDumbDonkey
@TheDumbDonkey 9 месяцев назад
had the same issue. Dont use PlayerPrefs.GetInt("UnlockedLevel1", 1); instead use PlayerPrefs.GetInt("Unlockedlevel", 1); and dont put level 1 as part of the buttons in the levels panel
@noahstella4289
@noahstella4289 Год назад
How do I reset the levels unlocked?
@RehopeGames
@RehopeGames Год назад
Hello , if you run this code All level progress will reset. PlayerPrefs.DeleteAll();
@noahstella4289
@noahstella4289 Год назад
@@RehopeGames Thanks
@maciek1831
@maciek1831 8 месяцев назад
@@RehopeGames Hi, i made a button "delete progress", added the DeleteProgress() function to the script with PlayerPrefs.DeleteAll(); but it does not lock the levels again when i click the button, any idea why and how to fix that? Also, big thanks for this video, great help!
@maciek1831
@maciek1831 8 месяцев назад
ok I added PlayerPrefs.Save() to the Awake and now the button resets the progress but only when I play again, the buttons are still unlocked when i cycle through scenes and main menu
@syfenw6586
@syfenw6586 Год назад
on me it says index was outof bounds of the array when i click play
@RehopeGames
@RehopeGames Год назад
Did you follow me step by step ?
@syfenw6586
@syfenw6586 Год назад
@@RehopeGamesi didt see the other videos only this, and i followed this video step by step
@1onGoogle
@1onGoogle 5 месяцев назад
Wow wow❤. Thank you so much❤
@mainuddinsadman7583
@mainuddinsadman7583 11 месяцев назад
What is this Project name??
@RehopeGames
@RehopeGames 11 месяцев назад
I gave the project the name 2D Platformer
@be0cly
@be0cly Год назад
Does this work on 3D?
@RehopeGames
@RehopeGames Год назад
Yes of course 😉
@AliSafari-b3q
@AliSafari-b3q Год назад
thank you so much this is a helpfull
@RehopeGames
@RehopeGames Год назад
I'm glad hear that. Thanks 😊
@zabech
@zabech Год назад
Hello Thanks for the tutorial but can you send me the script please i am lazy to rewrite :D ty
@RehopeGames
@RehopeGames Год назад
😂 Hi! I'm gonna share all project soon.
@Xnwifioggomwnw
@Xnwifioggomwnw Год назад
7:16
@RehopeGames
@RehopeGames Год назад
@Xnwifioggomwnw
@Xnwifioggomwnw Год назад
5:59
@RehopeGames
@RehopeGames Год назад
@youtubemusic415
@youtubemusic415 Год назад
how do i lock levels if i exit the game?
@RehopeGames
@RehopeGames Год назад
You wanna reset the game progress when exit the game ?
@youtubemusic415
@youtubemusic415 11 месяцев назад
yes@@RehopeGames
@youtubemusic415
@youtubemusic415 11 месяцев назад
my level selection is not working now after i did no open the project in a week @@RehopeGames
@youtubemusic415
@youtubemusic415 11 месяцев назад
how could i reset the unlocked level? @@RehopeGames
@youtubemusic415
@youtubemusic415 11 месяцев назад
@@RehopeGames please help me my other levels doesnt unlock even i reach the finish point i check the codes and are all the same but its still doesnt work please help this is the code in my finishpoint using UnityEngine; using UnityEngine.SceneManagement; public class Finish : MonoBehaviour { private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Player") { UnlockNewLevel(); GameManager.MyInstance.Finish(); } } private void OnTriggerExit2D(Collider2D collision) { if (collision.tag == "Player") { UIManager1.MyInstance.HideVictoryCondition(); } } void UnlockNewLevel() { if(SceneManager.GetActiveScene().buildIndex >= PlayerPrefs.GetInt("ReachedIndex")) { PlayerPrefs.SetInt("ReachedIndex", SceneManager.GetActiveScene().buildIndex + 1); PlayerPrefs.SetInt("UnlockedLevel", PlayerPrefs.GetInt("UnlockedLevel", 1) + 1); PlayerPrefs.Save(); } } } this is the code in my Level Menu using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class LevelMenu : MonoBehaviour { public Button[] buttons; public GameObject back; private void Awake() { int unlockedlevel = PlayerPrefs.GetInt("Unlockedlevel", 1); for(int i = 0; i < buttons.Length; i++) { buttons[i].interactable = false; } for(int i = 0; i < unlockedlevel; i++) { buttons[i].interactable = true; } } public void Earth() { SceneManager.LoadScene("EarthScene"); } public void Fire() { SceneManager.LoadScene("FireScene"); } public void Water() { SceneManager.LoadScene("WaterScene"); } public void Air() { SceneManager.LoadScene("EarthScene"); } public void Backbutton() { back.SetActive(false); } }
@galaxyslayerinfinite8448
@galaxyslayerinfinite8448 Год назад
Hi i need some help with this, these errors popped up as soon as I finished the script for the finishpoint Assets\FinishPoint.cs(16,48): error CS0103: The name 'SceneManager' does not exist in the current context Assets\FinishPoint.cs(14,76): error CS0103: The name 'ReachedIndex' does not exist in the current context Assets\FinishPoint.cs(14,13): error CS0103: The name 'SceneManager' does not exist in the current context did I do something wrong?
@galaxyslayerinfinite8448
@galaxyslayerinfinite8448 Год назад
also is there a way i could reset the levels with I link it to a "new game" button in the home screen?
@RehopeGames
@RehopeGames Год назад
Did you create scene manager script ?
@RehopeGames
@RehopeGames Год назад
Yes you can reset using PlayerPrefs.DeleteKey(string key)
Далее
How make SWIPE LEVEL MENU in Unity?
13:33
Просмотров 21 тыс.
🦊🎀
00:16
Просмотров 235 тыс.
Ответы Мэил Ру
01:00
Просмотров 733 тыс.
Barno
00:22
Просмотров 720 тыс.
How I Made a 3D Platformer in 2D Game Engine
21:23
Просмотров 500 тыс.
Why I Started Game Dev In My Late 30s
7:32
Просмотров 22 тыс.
Giving Personality to Procedural Animations using Math
15:30
How to make a menu in Unity - UI Tutorial
26:27
Просмотров 186 тыс.
Creating a Custom Tab System in Unity
13:45
Просмотров 233 тыс.
6 Years of Learning Game Development
9:02
Просмотров 2,4 млн
My Experience Moving to Godot from Unity
16:54
Просмотров 27 тыс.
🦊🎀
00:16
Просмотров 235 тыс.