Тёмный

Unity Loading Screen | Beginner Tutorial (2022) 

SpeedTutor
Подписаться 121 тыс.
Просмотров 44 тыс.
50% 1

Learn how to design and implement a loading screen in Unity. Loading your scenes asynchronously can help reduce the time users have to wait between scenes but I'll teach you something that most tutorials don't even mention!
➡️Slider Tutorial: • How To Create UI SLIDE...
➡️Black Friday Sale: • INSANE Year For Unity ...
🎁 Get OVER 165+ Scripts, Projects and premium content on my PATREON HERE:
➡️bit.ly/SpeedTutorPatreon
➡️Download the Project here: / 74781420
·························································································
🔥 INSANE UNITY SAVINGS: bit.ly/UnitySalesHub
🕹️Unity BLACK FRIDAY SALE: bit.ly/UnitySalesHub
🕹️SpeedTutor Unity Store: bit.ly/STUnityStorePuzzlePacks
🕹️Unity New Release Discount Sale: prf.hn/l/BdvEmg3
🕹️Unity WELCOME2022 Offer: bit.ly/UnityWelcome2022OFFER
🔥 INSANE HUMBLE SAVINGS: bit.ly/HumbleBundleDeals
🕹️Game Art in Blender Tutorial Bundle: bit.ly/GameArtBlenderTutorials22
🕹️Low Poly 3D Bundle: speedtutor.net/LowPoly3DHumble
🕹️Unity Tech book Bundle: bit.ly/ProgrammingMegaBundle
🔥Unity Materials / Files & More:
🕹️CGAxis PBR Deals: bit.ly/CGAxisPBRDeals
🕹️Synty Assets: bit.ly/SyntyLowPolyAssets
🕹️Filebase Assets: filebase.gamedevhq.com/ (Code: SPEEDTUTOR2022 - Sign up for a FREE MONTH)
🔥 UNITY SUBSCRIPTIONS:
🕹️Unity Plus: bit.ly/UnityPlusDeals
🕹️Unity Pro: bit.ly/UnityProDeals
·························································································
💰BIG DISCOUNTS on my website, for my UNITY ASSETS:
➡️www.speed-tutor.com
💬Join the Community Discord:
➡️ / discord
💝 Make a donation to the channel:
➡️www.paypal.me/speedtutor
·························································································
⬇️ SpeedTutor Puzzle Assets:
🧩Unity Store: bit.ly/STUnityStorePuzzlePacks
🧩My Website Discounts: www.speed-tutor.com/
⬇️ SpeedTutor Best Selling Assets:
🧩Adventure Puzzle Kit: bit.ly/STAdventurePuzzleKit
🧩 Note & Letter System: bit.ly/STNoteLetterSystem
🧩Examine System: bit.ly/STExamineSystem
🧩Keypad System: bit.ly/STKeypadSystem
⬇️SpeedTutor Model Packs:
🧩Unity Store: bit.ly/STUnityStoreModelPacks
🧩My Website Discounts: www.speed-tutor.com/
My Assets include: Gas Mask, Flashlight, Generator, Themed Key , Padlock, Phone, Chess Puzzle, Lever, Valve Puzzle, Fuse Box & Safe Systems. Cardboard, Debris, Massive Models and more!
························································································
⭐ Connect with me:
💬| Discord: / discord
🐦| Twitter: / speedtutor
📱 | Facebook: / speedtutoruk
🖥 | Website: www.speed-tutor.com
·······················································································
#SpeedTutor #Unity #LoadingScreen

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

 

18 ноя 2022

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 51   
@SpeedTutor
@SpeedTutor Год назад
Slightly late upload today but here we are! Haha. I wanted to create this tutorial to give some good pointers to those who had struggled! 🔥NEW BLACK FRIDAY SALE!: bit.ly/UnitySalesHub 🔥SpeedTutor Unity Store: bit.ly/STUnityStorePuzzlePacks 🔥HUMBLE SAVINGS: bit.ly/HumbleBundleDeals
@vi6ddarkking
@vi6ddarkking Год назад
Interesting Tutorial. So Far All My Loading Screens Have Been For "Set Up" After The Scene Loads But Before I Want The Player To Take Control. Good To See how It's Made With The Scene.
@SpeedTutor
@SpeedTutor Год назад
Thanks very much for checking this out! :D
@CyberStudios
@CyberStudios Год назад
Excellent, thank you for this!
@SpeedTutor
@SpeedTutor Год назад
You're very welcome! :D
@gmangman123
@gmangman123 Год назад
very usefull my game menu! Thx my friend.
@SpeedTutor
@SpeedTutor Год назад
You're very welcome, thanks for watching! :)
@gabrielplourde6791
@gabrielplourde6791 Год назад
Loading bars: the ultimate lie lol
@SpeedTutor
@SpeedTutor Год назад
Haha, tell me about it! :P
@mrunalumate5399
@mrunalumate5399 2 дня назад
thnks brother
@SpeedTutor
@SpeedTutor 2 дня назад
You're very welcome!
@hnentertainmentslk
@hnentertainmentslk Год назад
Nice
@SpeedTutor
@SpeedTutor Год назад
Thanks for checking this out! :D
@user-fx6hs8lv5z
@user-fx6hs8lv5z Год назад
my loading screen just flashes by it stays like for 1 second
@1984ordep
@1984ordep Год назад
Im wondering if you might help me. Im learning and I have created a level select in my game like super Mario world. SO the character moves around the map and when it lands on a level square you hit space and the level load. Being that I'm not using BUTTONS how would I trigger the load screen with the example you showed here. Hope you can help me understand a bit more. THANK YOU
@SpeedTutor
@SpeedTutor Год назад
Hey there, you can take the exact code that activates on a button press and just do the same on a trigger event. Like "OnTriggerEnter". Does that make sense?
@1984ordep
@1984ordep Год назад
@@SpeedTutor that makes sense... Im trying to implement it into my own script. The map points are the locations on the map that my character moves to and if that's a LEVEL and I beat the one level before that one then it lets me press a button and the level loads. You gonna notice some things like gems and stuff which are just little icons that populate over the level graphic.....I get the idea of using an OTriggerEnter2D but im not quite sure where in the code to do it I keep playing with it and I keep getting error. Would love your input.. Here is my map code using System.Collections; using System.Collections.Generic; using UnityEngine; public class MapPoint : MonoBehaviour { public MapPoint up, right, down, left; public bool isLevel, isLocked; public string levelToLoad, levelToCheck, levelName; public int gemsCollected, totalGems; public int BigCoinCollected, totalBigCoin; public float bestTime, targetTime; public GameObject gemBadge, timeBadge, BigCoinBadge; // Start is called before the first frame update void Start() { if(isLevel && levelToLoad !=null) { if(PlayerPrefs.HasKey(levelToLoad + "_gems")) { gemsCollected = PlayerPrefs.GetInt(levelToLoad + "_gems"); } if (PlayerPrefs.HasKey(levelToLoad + "_BigCoin")) { BigCoinCollected = PlayerPrefs.GetInt(levelToLoad + "_BigCoin"); } if (PlayerPrefs.HasKey(levelToLoad + "_time")) { bestTime = PlayerPrefs.GetFloat(levelToLoad + "_time"); } if(gemsCollected >= totalGems) { gemBadge.SetActive(true); } if (BigCoinCollected >= totalBigCoin) { BigCoinBadge.SetActive(true); } if (bestTime
@1984ordep
@1984ordep Год назад
@@SpeedTutor I also have another code that controls all the map points which is this one... using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class LSManager : MonoBehaviour { public LSPlayer thePlayer; private MapPoint[] allPoints; // Start is called before the first frame update void Start() { allPoints = FindObjectsOfType(); if(PlayerPrefs.HasKey("CurrentLevel")) { foreach(MapPoint point in allPoints) { if(point.levelToLoad == PlayerPrefs.GetString("CurrentLevel")) { thePlayer.transform.position = point.transform.position; thePlayer.currentPoint = point; } } } } // Update is called once per frame void Update() { } public void LoadLevel() { StartCoroutine(LoadLevelCo()); } public IEnumerator LoadLevelCo() { AudioManager.instance.PlaySFX(4); LSUIController.instance.FadeToBlack(); yield return new WaitForSeconds((1f / LSUIController.instance.fadeSpeed) + .25f); SceneManager.LoadScene(thePlayer.currentPoint.levelToLoad); } }
@alejandro60251
@alejandro60251 8 месяцев назад
Amazing tutorial mate, I have just one question. When I implemented the loading bar into my game it goes from 0 to 34%, and then goes back to 22% and then freezes there and finally goes all the way to a 100% when the game is about to load. Is there anything you know I can do about it?
@SpeedTutor
@SpeedTutor 8 месяцев назад
That's a tough question, I'm not sure I can give you a good answer other than trying to do some searching online. Sorry about that .
@RandomDude00001
@RandomDude00001 Месяц назад
I think you messed up the bar it self I think sorry I just started a minute ago
@debmarkproductions
@debmarkproductions 4 месяца назад
I was wondering if your routine will work with the initial loading of the game itself that takes 5 minutes before starting, or is it just for loading other levels while the game is running. If it doesn't work for game loading, do you have any information on how to do that? Thanks.
@SpeedTutor
@SpeedTutor 4 месяца назад
I imagine it should work for something like that, but 5 minutes a pretty long time. What's the project? If you don't me asking.
@debmarkproductions
@debmarkproductions 4 месяца назад
I am about 2/3 done with level 1, of probably 5, of "The Tower of Destiny" and it already takes up 7.5 GB. It is a semi-realistic Christian adventure game where the player goes through a wilderness on a path coming across various buildings where he meets different characters. He has to determine if they are telling him the truth or trying to deceive him. At some of the houses he is fed with spiritual food (Bible verses) that act as weapons against deceiving demons to dispel them. He must use the correct verse to counter what the demon tells him or he will be injured himself. The purpose of the game is to teach what salvation is all about, to help memorize Bible verses, and to help respond to those who ask for a reason for the hope that Christians have (otherwise known as apologetics). The target audience is anyone over 6 yrs old.
@SpeedTutor
@SpeedTutor 4 месяца назад
I think that's a very honourable creation but what makes the game take 5 minutes to load? It's something that won't go down with players, as they hate waiting. Haha.
@Justeeee115
@Justeeee115 26 дней назад
Hi the loading is awesome works fine but is there anyway to slow down the loading to at least like a minimum of 5secs cause the loading flashes before my eyes that I don't need the loading anymore. Anyways I'm working in a 2d game of course its lightweight anyways I run the the game in built version.
@SpeedTutor
@SpeedTutor 26 дней назад
That's a tough question as it's super light weight but you could create a co-routine to wait a number of seconds after the a sync operation has completed, you know it's done loading but you just wait for your allotted time before activating. I'm not sure if it's the best way but a suggestion.
@Justeeee115
@Justeeee115 25 дней назад
@@SpeedTutor Thanks for the suggestion. but I did something else, Idk if this the best way to go but I was so desperate to have a long loading screen (Since its a intro loading of the game) I just animate the whole loading screen and throw a coroutine, after that coroutine is done the main menu scene loads. I know its a pretty bad idea, but it works for me. I guess.....
@SpeedTutor
@SpeedTutor 25 дней назад
Sometimes the thing that works doesn't have to be the very best, your loading in fast anyway. So I'm glad you've got it sorted :)
@RHYSHALLDIGITALART00122
@RHYSHALLDIGITALART00122 7 месяцев назад
will this work with photon 2. this is by far the hardest thing ive added to my game and im not an amatuer. however its multiplayer so networking may be an issue.
@SpeedTutor
@SpeedTutor 7 месяцев назад
I'm really not sure about that one, I'm not experienced with multiplayer at all but I imagine it should work.
@Garfield_Minecraft
@Garfield_Minecraft 3 месяца назад
so there's no way to fix in editor?
@SpeedTutor
@SpeedTutor 3 месяца назад
I'm not sure about that one, as the editor does things slightly differently.
@khajanawaz4136
@khajanawaz4136 11 месяцев назад
Can we remove unity loading screen in webgl can you make a video on this
@SpeedTutor
@SpeedTutor 11 месяцев назад
You mean the Unity splash screen that automatically appears? If that's what you mean, sadly not unless you subscribe to Unity Plus or Pro. I think plus is the lowest version you'd need to get rid of it.
@khajanawaz4136
@khajanawaz4136 11 месяцев назад
@@SpeedTutor i mean after splash screen comes loading screen i want to remove that loading screen from webgl
@SpeedTutor
@SpeedTutor 11 месяцев назад
I don't think you can get rid of that one but I'm not 100% sure about that!
@alaxi-ball2453
@alaxi-ball2453 5 месяцев назад
where do you get the background to load the game?
@SpeedTutor
@SpeedTutor 5 месяцев назад
Could you explain a little more for me?
@alaxi-ball2453
@alaxi-ball2453 5 месяцев назад
@@SpeedTutor I mean, where do you get the background of the loading screen?
@SpeedTutor
@SpeedTutor 5 месяцев назад
Oh it's just a screenshot of one of the games I was making :)
@juniorski487
@juniorski487 11 месяцев назад
my loading screen just flashes by it stays like for 1 second and how to fix this like i want more longer 4-5 sec max
@loganblizzard6869
@loganblizzard6869 11 месяцев назад
How big of a scene are you loading?
@SunSailor
@SunSailor Год назад
And yet - the best loading screen is always the one, you don't need. Let's face it, bulk loading is always some kind of laziness. Not always avoidable, because setting up streaming is more work and needs more robust systems, but at the end, it is always technically possible. Simply look at lands of lore on the C64, which already streamed a whole open world on a 1Mhz machine with 64KB RAM and an ultra slow disk drive with 170KB. Eventually, we moved away from scenes anyway and use addressables instead, which give a much more grained control on loaded and unloaded assets.
@SpeedTutor
@SpeedTutor Год назад
I can agree on that but sometimes to ship a perfectly functional game, this isn't always or even possible as you mention. More ingrained systems come with experience, especially when you have so many other facets to deal with. Thanks for your comment though! :)
@vandermunnik
@vandermunnik Год назад
I actually have a slight 'issue' with loading in my game. Perhaps you can help. I have an extra step nested in the while loop. This is the 'press to continue' code block (as I have a little story showing on my loading screen). Everything works as it should, but the thing is my loading bar is acting not as expected. It loads to about 6% normally, but then it stops showing the progression (percentage wise, the actual game is indeed still loading, but the player might think the game froze up), after a minute or so, it shoots up to 95/ 100 % and the press to continue can be done with space bar. I was hoping to see a somewhat more gradual loading progression from 0 to 100 with maybe some chunks loaded faster here and there. This is the code I'm using public class LevelLoader : MonoBehaviour { [SerializeField] private int sceneToLoad; [SerializeField] private Slider loadingBar; [SerializeField] private TextMeshProUGUI percentageText; [SerializeField] private GameObject loadingIcon; [SerializeField] private TextMeshProUGUI pressContinue; private void Start() { pressContinue.enabled = false; loadingIcon.SetActive(false); LoadScene(sceneToLoad); } public void LoadScene(int sceneIndex) { StartCoroutine(LoadAsynchronously(sceneIndex)); } IEnumerator LoadAsynchronously(int sceneIndex) { AsyncOperation operation = SceneManager.LoadSceneAsync(sceneIndex); loadingIcon.SetActive(true); operation.allowSceneActivation = false; while (!operation.isDone) { float progress = Mathf.Clamp01(operation.progress / .9f); loadingBar.value = progress; percentageText.text = (progress * 100f).ToString("F0") + " %"; if (operation.progress >= .9f && !operation.allowSceneActivation) { loadingIcon.SetActive(false); pressContinue.enabled = true; if (Input.GetKeyDown(KeyCode.Space)) { operation.allowSceneActivation = true; } } yield return null; } } } Is there something I can improve on?
@SpeedTutor
@SpeedTutor Год назад
Are you having this issue directly in the editor or within a build too?
@vandermunnik
@vandermunnik Год назад
@@SpeedTutor As far as I know the only way to test the loading bar properly is in build. In the editor there are no errors in the console, that makes it so tricky to see the problem. If there is even a problem since everything works as it should. It's just the 'freezing' of the loading bar that may throw players off, thinking the game froze while this isn't the case. The level loads fine after a minute or so on my HDD. (I couldn't test it on SSD since it loads so fast the bar goes from 0 to 100 in 1 sec :😜). I'm trying to understand what (and how) Unity loads in the background while it's loading asynchronously.. seems in my level it's the first chunk of data then it has a hard time reflecting the rest of it. I really should test this with another scene...
@AvstractIndustries
@AvstractIndustries Год назад
Tomorrow is Monday 😁
@SpeedTutor
@SpeedTutor Год назад
You're exactly right! :D
@barzanfuntime6486
@barzanfuntime6486 26 дней назад
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement; public class startScene : MonoBehaviour { public Slider loadingSlider; public string sceneName; public GameObject startButton; bool loading; AsyncOperation asyncOp; public void startGame() { loadingSlider.gameObject.SetActive(true); asyncOp = SceneManager.LoadSceneAsync(sceneName); loading = true; startButton.SetActive(false); } void Update() { if(loading == true) { loadingSlider.value = asyncOp.progress; if(asyncOp.progress >= 0.99f) { asyncOp.allowSceneActivation = true; } } } }
Далее
How to make AWESOME Scene Transitions in Unity!
19:45
Просмотров 921 тыс.
Designing a Loading Screen in Unity
11:57
Просмотров 177 тыс.
Gale Now VS Then Edit🥵 #brawlstars #shorts
00:15
Просмотров 317 тыс.
MAIN MENU in Unity (Best Menu Tutorial 2024)
1:24:21
Просмотров 195 тыс.
Unity Loading Screen - Easy Tutorial
4:28
Просмотров 73 тыс.
6 Ways To SAVE Your UNITY PROJECT from ruin!
12:14
Просмотров 1 тыс.
How I designed Fruit Ninja
22:58
Просмотров 6 млн
Animating a Stick Fight in 10 Seconds vs 10 Hours
11:53
How to make a LOADING BAR in Unity
11:25
Просмотров 738 тыс.
How to make a LOADING Screen in Unity
8:25
Просмотров 18 тыс.