Тёмный

How to make a LOADING BAR in Unity 

Brackeys
Подписаться 1,8 млн
Просмотров 743 тыс.
50% 1

Let's create a progress bar!
● Download the scene: www.assetstore...
● Written tutorial by Alan Zucconi: www.alanzucconi...
❤️ Donate: www.paypal.com...
····················································································
► Join Discord: / discord
♥ Subscribe: bit.ly/1kMekJV
● Website: brackeys.com/
● Facebook: / brackeys
● Twitter: / brackeystweet
········································­­·······································­·­····
Edited by the lovely Sofibab.
········································­­·······································­·­····
► All content by Brackeys is 100% free. I believe that education should be available for everyone. Any support is truly appreciated so I can keep on making the content free of charge.
········································­­·······································­·­····
♪ Baby Plays Electro Games
teknoaxe.com/cg...

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

 

28 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 814   
@bigjiggly7490
@bigjiggly7490 7 лет назад
Brackeys is definitely the best Unity channel out there. Better than the actual Unity channel. I always love seeing the new videos even if they're teaching me stuff I know or stuff I'm not interested in. Great channel!
@TheRealOderless635gnat
@TheRealOderless635gnat 4 года назад
BigJiggly and alvinblox is the beat roblox studio channel Go to roblox.com/create and then install it u need a roblox account as well and go to help.roblox.com and keep ur account safe
@Scorpion-mw3qc
@Scorpion-mw3qc 3 года назад
He is better than avarage but not best
@bigjiggly7490
@bigjiggly7490 3 года назад
@@Scorpion-mw3qc This was 3 years ago, since then I've pretty much moved onto larger projects. Networking, Reverse Engineering, Modding, you name it. Looking at Brackeys with a much more advanced understanding I can tell it is in fact pretty avarage, a lot of bad practices are performed during the scripting tutorials. He's still a massive inspiration and a great source for beginners.
@Scorpion-mw3qc
@Scorpion-mw3qc 3 года назад
@@bigjiggly7490 yeah I agree
@tomtomkowski7653
@tomtomkowski7653 3 года назад
Brackeys - we miss you... your tutorials are still the best, short, informative, and well explained.
@FelineRaptor-gv4te
@FelineRaptor-gv4te 2 года назад
hi i am havinga trouble. the loading bar does from 0% then after a while directly to 100% instead of smoothly transitioning. what can I be doing wrong? my code matched the code brackeys wrote.
@yarriksauker993
@yarriksauker993 2 года назад
@@FelineRaptor-gv4te no one will help you brackeys is gone
@FelineRaptor-gv4te
@FelineRaptor-gv4te 2 года назад
@@yarriksauker993 i know that. sorry, i figured it out. it happens only the first time i load the scene. from the next time the problem randomly happens and randomly doesn't happen. never mind. but brackeys is gone doesn't mean anyone else can't help me though
@FoxHoundUnit89
@FoxHoundUnit89 2 года назад
@@yarriksauker993 the beauty of these comments is that anyone can read them and answer questions. Or you can just be an asshole and waste everyone's time by reply g without answering the question.
@ishan9050
@ishan9050 2 года назад
@@FelineRaptor-gv4te Loading doesn't happen smoothly. Its normal for the loading to change values abrubtly depending on the scene and objects in it your're trying to load
@rodolforubens
@rodolforubens 7 лет назад
The video quality is so clean that it looks like it's running on my machine.
@Brackeys
@Brackeys 7 лет назад
Glad you like it! :) I use OBS to record 1920x1080 in 60fps with a bitrate of 8000 kbps - Just in case anyone is interested!
@rodolforubens
@rodolforubens 7 лет назад
Thanks for sharing! Thanks for the tutorial too!
@SxAde
@SxAde 7 лет назад
Isn't Asbjørn one of the nicest developers and tutors on the Internet?
@KrakinTheKonsole
@KrakinTheKonsole 4 года назад
@@Brackeys WHAT 8000 KBPS !??!?!?!??!?? REALLY I Record at 1500 Kbps
@KrakinTheKonsole
@KrakinTheKonsole 4 года назад
At 1280x720
@chriswranek6569
@chriswranek6569 7 лет назад
Hey Brackeys I just want to say that your videos are some of the best programming and game making videos on the entire internet. I could not hold them in higher regard in terms of how much they've helped and still are helping me to this day in fact. All I can thank you and keep up the amazing work!
@VoodooMadMike41
@VoodooMadMike41 5 лет назад
Cheers! I managed to use this to incorporate a loading bar to my splash screen :)
@HarishKumar-zr2dy
@HarishKumar-zr2dy 6 лет назад
Wow. I was always wondering how you do it. I mean how smooth your workflow is !!
@daddycanstudio7506
@daddycanstudio7506 3 года назад
Чувак ты крут, у тебя есть практически все ответы на вопросы которые я ищу, спасибо
@zaranasolanki3186
@zaranasolanki3186 2 года назад
This video saved me!!! I was stuck on making a Loading Scene since 3 days and my problem was solved in just a few minutes! Thanks a lot!! :))
@thatguyplayz0nmobile471
@thatguyplayz0nmobile471 3 года назад
You missed the part where when it hits 99% it pauses for a long while XD
@DutchDeveloper
@DutchDeveloper 7 лет назад
Hello Brackeys. i got an question how can i recieve data from a web api. i got the data bot how i can convert the json so the c# can use it?
@DiamondHeart117
@DiamondHeart117 7 лет назад
RTS tutorial series...please? Maybe something where you can build structures anywhere like in Command & Conquer, or on fixed spaces like in Halo Wars? I've seen this asked before and sorry if it's a lot for you, we all just like your tutorials so much. Keep it up! Oh and nice vid btw!
@Jamesthe1
@Jamesthe1 7 лет назад
I learned a lot of things just from this simple video. Thanks! (I came from Sebastian Lague)
@LittleRainGames
@LittleRainGames 7 лет назад
actually that is not why brackeys. It's because once it reaches 1 it will not be running the while loop, which means it will not call the debug.log.
@nullx2368
@nullx2368 7 лет назад
LittleRainGames agree with you, I'm not sure how it works but this is also what I thought.
@snodingamer
@snodingamer 7 лет назад
that is actually really cool
@marmikemp3767
@marmikemp3767 2 года назад
Thanks brackeys
@z3ming874
@z3ming874 7 лет назад
Great video Brackeys! Can you maybe make a video/series on how to roll a ball? I'm aware that there are others out there, but yours are always the best!
@csfox3733
@csfox3733 4 года назад
i like ur content man and starting right now with c++ and keep it to can use the unity programme :)
@bharathball
@bharathball 3 года назад
:( i caant finnd the problem whenever i click the button unity stops responding,unity wont even close!
@Jaroslavkr
@Jaroslavkr Год назад
Thank you so much :) but i stil miss you :(
@germanvisitor2
@germanvisitor2 2 года назад
Is it possible to set a minimum loading time, in case you have an elaborate loading screen and want people to see it even if the level loads quickly?
@roefusama
@roefusama 5 лет назад
Just wanna ask if you guys have a tutorial where once you press/click the "new game", the loading screen will show
@genedrive6363
@genedrive6363 4 года назад
question I'm using this on a bigger project but is stutters a lot and then suddenly goes to 100% do you know how to fix this?
@flameprincess7313
@flameprincess7313 4 года назад
I have the same problem. Mine goes from 0 to 89 always, then stays there a few sec and then its done.. Loading isn't smooth
@StephenAllenGames
@StephenAllenGames 4 года назад
Nice and simple, thanks!
@redouanekachach9181
@redouanekachach9181 4 года назад
Very concise and helpful. Thank you very much :D
@LightArtsOfficial
@LightArtsOfficial 7 лет назад
Awesome video just you are making it as always to look easy! :)
@ColBaek
@ColBaek 2 года назад
알고 있는 내용이지만.굿이요!
@Alex-mm2vw
@Alex-mm2vw 4 года назад
It doesn't work for me. Mine just jumps from 0% to 100% within 6 seconds. It's 6 seconds on 0, then on 100 immediatly. The Debug shows that it should be working, because I get Numbers like 0.3, but all happens at once. It seems like everything freezes and then BOOM, it loads everything in one millisecond, just after 6 seconds.
@jesusjimenez-yf2zv
@jesusjimenez-yf2zv 3 года назад
Esta información vale millones
@moacirsilveirajr
@moacirsilveirajr 4 года назад
Hello... With this worked in parts. The % jump from 0 to 100, do not load in parts... I am done equal to video... The scene is big, the progress bar stay in 0% for 10s, then jump to 100%
@flameprincess7313
@flameprincess7313 4 года назад
Same problem, did you fix it?
@doggo4616
@doggo4616 7 лет назад
Yes!!! It worked!!! Thank you so much!!!
@dami4335
@dami4335 7 лет назад
What happened with rewind time video?^^
@timetoexplore7603
@timetoexplore7603 7 лет назад
It is probably private for his Patreon supporters and might be available for us at a later time.
@dami4335
@dami4335 7 лет назад
Thanks for info
@volutedberet
@volutedberet 4 года назад
Thanks!
@metanira94
@metanira94 6 лет назад
IT WORK!, thank you too much, clean code, easy to make.
@TheRealOderless635gnat
@TheRealOderless635gnat 4 года назад
Roblox studio master : Alvin BLOX Unity master : **i mean brackeys**
@jingyitay47
@jingyitay47 4 года назад
I followed the video exactly and my game is on the android platform. When I pressed "Play", my slider and the progressText will not be changed. Slider will not move and my percentage will be at 0%. After a few seconds, it will just load my next scene. Can anyone help me? I am currently using unity 2019.4.1f1 build.
@akkuyotaisan1116
@akkuyotaisan1116 6 лет назад
I kinda want a loading scene with no loading bar,just a scene that load the game,showing a sprite of my character skating,what should i do?
@nishchaysingh5980
@nishchaysingh5980 3 года назад
The scene is unavailable which is given in the description. Please help someone 🙏🙏🙏🙏
@shijinmohammed448
@shijinmohammed448 7 лет назад
hey brackeys, great video... btw can you pls create a video on running two animations(one on player and another on enemy/ai) at the same time like combo moves or stealth finishings... you dont have to go that deep... was just mentioning them to let you get the idea of what I mean...
@inex550
@inex550 5 лет назад
Thank you!
@JacksonBroom
@JacksonBroom 7 лет назад
Love this thank you very much.
@gamesfordlegend
@gamesfordlegend 11 месяцев назад
nice video buh i have one issues mine is not working .. followed everything as you said buh seems my own is on pause like its not working when the scene is changing.. please help me out
@laserbean00001
@laserbean00001 9 месяцев назад
What does your code look like?
@sazzadkhan9391
@sazzadkhan9391 7 лет назад
wow.. love you buddy
@didicayu
@didicayu 6 лет назад
what about the basics of a top down shooter game as the unity shooter test scene?
@gn65776
@gn65776 6 лет назад
good teaching :)
@N-.-A
@N-.-A 7 лет назад
Nice keep it up!
@itswaru8983
@itswaru8983 2 года назад
how could i make the next scene load on start, instead o being triggered by a button?
@c0deventures
@c0deventures 3 года назад
The progress stops at 0.9 in your program not because of how Unity script works, but because of your code! In your while condition you're testing if the operation has finished. And if it is (progress = 1 and operation.isDone = true), you don't call Debug.Log anymore! This is an example of dirty code no offense :)
@MassaJPN
@MassaJPN 2 года назад
After reaching 100% progress percentages, I have to wait more seconds(10-20sec), in that case, the progress percentage is ghost or should I change some codes?
@chaosmongerstudio
@chaosmongerstudio 5 лет назад
I'm having the same problem that someone else in the comments mentioned... My loading slider (and text) gets super fast to 100% then everything freezes - I've also animations - then I've to wait 10-15 seconds with a frozen loading scene before the new scene actually appears.
@hosseingorji2240
@hosseingorji2240 5 лет назад
it's very good idea for games
@eremix4107
@eremix4107 5 лет назад
YOU ARE VERY COOL RU-vidR
@everton.colombo
@everton.colombo 6 лет назад
Doing a quick review before LD41 haha
@sparxdev
@sparxdev 5 лет назад
My GUI freezes when I load a level...? D:
@Triggerly
@Triggerly 4 года назад
me too
@darkhackerstudio8112
@darkhackerstudio8112 4 года назад
It might be because you didn’t build it using the build and run pannel
@mouhcine4831
@mouhcine4831 7 лет назад
Nice !
@AldreineMAlpas
@AldreineMAlpas Год назад
Someone : *shows this* [ ] People that dint get it: what is that supposed to mean? Me: 😭
@AHEK8
@AHEK8 Год назад
It's for creating list and store multiple values in a variable it's called ARRAYS
@arjunmenon3817
@arjunmenon3817 4 года назад
What will i have to change if i want a delay for about 3 seconds!
@mehkip4975
@mehkip4975 7 лет назад
hello great video man I really like the way you explain stuff in your tutorials also can you please make a tutorial on how to use maya 2017 to make 3d models for games and thanks in advance
@alitajik7478
@alitajik7478 3 года назад
anyone know what theme he uses?
@waterbottle48
@waterbottle48 6 лет назад
brackeys do you know how to make the camera go onto the canvas because it is not working for me
@chaitanyameshram4415
@chaitanyameshram4415 4 года назад
Sir I have a problem regarding loading bar, Loading bar are not gradually increase it suddenly filled up, what should I do
@1234yokee
@1234yokee 3 года назад
hello sir. I have a problem. My project have Scene 1 and Scene 2.I preloaded Scene 1 In the Scene 2. But Scene 1 UI show on the Scene 2. So how to hide it? Help me Sir,thank you(sorry for my english skill)
@ZiaurRahmanAdvocate
@ZiaurRahmanAdvocate 5 лет назад
Can you please share one video on flow free game
@yudingzhou8683
@yudingzhou8683 4 года назад
nice!
@random_precision_software
@random_precision_software 7 лет назад
I have put mp4 video on my game..easily enough..but when I want to put it on a canvas UI I seemingly can't do it..Can it be done..my canvas has buttons to select and an animation background?
@puncherbear3561
@puncherbear3561 6 лет назад
Hello in the game I'm making when you switch between scenes the light either takes a long time to load or it doesn't could you help me please,thanks.
@Warrorar
@Warrorar 4 года назад
there is either a bug in Unity or this does not work as you describe it. Whatever I do, it always jumps from 0 to 1 or 0.9 whatever I do (your code). If I include a level with enormous content amount it just jumps to 0.9 and hangs for some seconds. it's weird.
@APaleDot
@APaleDot 4 года назад
Have you tried running a build of the game? it could be an artifact of running in the editor.
@Warrorar
@Warrorar 4 года назад
@@APaleDot Yes, the same behaviour. I also found several years old bug tickets. Funny Tho, I know that in 2015 I used the same async loading on Unity4, and apparently, they broke it in Unity5 and never fixed it. So it is actually really broken. That it looks "working" in this video and others, is because it loads to fast. If he would load an enormous scene, it would be visible that it also jumps there from 0 to 0.9 and hangs in between. not his fault, just a bug in unity tho :/
@APaleDot
@APaleDot 4 года назад
@@Warrorar But at 9:15 he does load a larger level. If you look at the progress bar frame-by-frame, you'll see it does hit some values between 0 and 1.
@Warrorar
@Warrorar 4 года назад
@@APaleDot where exactly? there is nothing except 0,90 and 100. and that's exactly the bug which is even accepted by the unity devs.
@APaleDot
@APaleDot 4 года назад
@@Warrorar I gave you a timestamp: 9:15
@frostmusicofficial
@frostmusicofficial 7 лет назад
How would I implement this on UNet, I am making a modern FPS following his FPS tutorials.
@ZayOG36
@ZayOG36 7 лет назад
make a video on how to make a level bar with rewards
@humanwelcomemat9532
@humanwelcomemat9532 4 года назад
mine doesn't work any tips?
@mohamedtarek3798
@mohamedtarek3798 4 года назад
My console is like 0.1838392 0.4729293 0.8738392 0.9273920 1 1 1 1 1 ( 54 massages of number " 1 " ) And when I finished the tutorial the slider value sticks on filled for 3 seconds then load ,any help
@sharif47
@sharif47 6 лет назад
Brackeys really hates the Start and the Update functions. 😅
@turksinnovations
@turksinnovations 5 лет назад
I'm starting too as well lol. I Hardly use the functions now that I think about it 😅.
@user-db1uj2px9l
@user-db1uj2px9l 5 лет назад
LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOL !!!! LMFAOOOOO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! HOLY SHIT BRO IM DEAD I CANT BREATHE LMAOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO U KILLING ME BRUH
@jesse578
@jesse578 5 лет назад
@@turksinnovations I actually love them! I use them almost everytime!
@voidling2632
@voidling2632 5 лет назад
you should avoid them as much as possible. Atleast update function. It's not good for perfomance.
@jesse578
@jesse578 5 лет назад
@@voidling2632 Usually I have to check if something is true constantly and why would I need to avoid the start function? Sometimes you need to do check something right at the start.
@CeretPenyok
@CeretPenyok 7 лет назад
Are you a teacher? You're so good at explaining fast and to the point. I like it.
@BenPalladino
@BenPalladino 5 лет назад
Was gonna like this comment. But gonna let it sit at 69 likes.
@NSTATS
@NSTATS 5 лет назад
@@BenPalladino Guess we have to like your comment instead
@coolboidoesstuff9828
@coolboidoesstuff9828 5 лет назад
liked this comment, but then looked at the replies and unliked it
@zokaper801
@zokaper801 5 лет назад
r/mildlyinfuriating and r/madlads
@trubiso
@trubiso 4 года назад
@@zokaper801 please don't use subreddits out of reddit =/
@quixzotic
@quixzotic 7 лет назад
Wow this video was published 24 min ago and it already has 735 views! 105 likes! 0 dislikes! Wow Brackeys you are truly the best.
@diegocrusius
@diegocrusius 7 лет назад
thanks to him I finally got rid of my fear of working on unity and now I'm fully working on it
@eswaransubramaniam3196
@eswaransubramaniam3196 6 лет назад
Snu,allalak
@zaidmermam2524
@zaidmermam2524 4 года назад
Now after two years : 171 d.likes 11k likes +400k views 😅
@Scorpion-mw3qc
@Scorpion-mw3qc 3 года назад
dont u see 201 dislikes?
@futuremapper_
@futuremapper_ 3 года назад
@@Scorpion-mw3qc this comment was 3 years ago....
@tabooization123
@tabooization123 Год назад
this was helpful thank you barckeys. miss you a lot
@zuckrprinz249
@zuckrprinz249 2 года назад
Even after almost 5 years the best tutorials on youtube. Brackeys not only used to show us what to do, but he actually explained everything in a way a total newbie could understand it. we miss you dude :(
@noisefond
@noisefond Год назад
If you're using TMPro in the percentage text add... //put at the top using TMPro; //put in the while(!operation.isDone) function public TMP_Text progressText;
@kidein5735
@kidein5735 9 месяцев назад
Ty man
@kira7683
@kira7683 6 лет назад
text.text = (progress * 100).ToString("F0") + "%"; to truncate number
@Kalahee
@Kalahee 4 года назад
text.text = progress.ToString("P#") or text.text = progress.ToString("0.0%"). Both will do x100 and add % accordingly to loaded CultureInfo. # is the number of decimals. Symbol for % may look odd for some culture, so you can do this text.text = progress.ToString("P#", CultureInfo.InvariantCulture);
@violentgamer5910
@violentgamer5910 4 года назад
thank you
@kapilbadokar
@kapilbadokar 4 года назад
My score of the game also appears...while the load level screen appears..??can someone help..
@kapilbadokar
@kapilbadokar 4 года назад
@@Kalahee My score of the game also appears...while the load level screen appears..??can someone help..
@Kalahee
@Kalahee 4 года назад
@@kapilbadokar If you're using a different scene for your loading bar, sounds like your score is on a gameobject that is set to DontDestroyOnLoad or something.
@ulicesisaia
@ulicesisaia 5 лет назад
Just a little improve, if you put the line "loadingScreen.SetActive(true); " before the "StartCoroutine", in the "LoadLevel" method, the panel will appear ALWAYS before the couroutine start, because in my project I try this and must of the time the panel (and obviously the slider) take too long to appear and the start menu was still visible for a tiny but visible time, so whit this little change work like a charm!! Thanks Brackeys, you rock!!! ♥
@plusone8879
@plusone8879 4 года назад
I'm still having this issue, loading screen takes a few seconds to appear and the slider is already at 100percent. I tried putting the set active true function before coroutine but it still does it. could there be another reason why?
@ulicesisaia
@ulicesisaia 4 года назад
@@plusone8879 sorry I don't remember this issue, but try putting that line of code in different places, maybe inside the coroutine? Your problem seems just a matter of order
@plusone8879
@plusone8879 4 года назад
@@ulicesisaia gonna try! Thanks for the response!
@plusone8879
@plusone8879 4 года назад
@@ulicesisaia It runs well in the build so I can live with this
@unitylordcail4648
@unitylordcail4648 2 года назад
At 10:15 -- With Unity2020.3LTS using TextMeshPro.. // Add this to top of file using TMPro; { ... // Instead of public Text progressText; public TMPro.TMP_Text progressText; ...
@iceee
@iceee Год назад
tysm
@hk-0148
@hk-0148 Год назад
Yes thank you! I'll let you know if this works!
@Notllamalord
@Notllamalord 2 года назад
Sigma rule #1: make a fake loading bar so people think your game is actually good
@panickal
@panickal 2 года назад
Sigma rule #1 Part B: Remove the loading bar and lag that you intentionally created and tell your players you "optimised" the game
@cosmobrain6432
@cosmobrain6432 4 года назад
Cool. How do you separate the loading and activating into separate functions? I want to have one button to load the level, and another to activate it when the player is ready, so the level can be loading while the player is interacting with a separate menu. For example, it could load while the player is selecting weapons/armour.
@Revy8
@Revy8 3 года назад
brackeys your videos are so good. Ive gone from knowing almost nothing about coding and game creating to full time indie dev in 3 months. Please come back and make more videos. How about an in depth shader graph tutorial?
@fated2pretendd
@fated2pretendd 8 месяцев назад
To anyone has a problem where your "Activation" phase takes too long to load, hence your loading bar is filled but the scene takes another few seconds to appear, I find a way to get around: Set operation.allowSceneActivation = false at the beginning of the coroutine, only let your loading bar run up to 90% as the operation.progress. The remaining 10% can be filled by using a lerp from 0.9 to 1 in 1 or 2 seconds. Then set the allowSceneActivation to true. That's way the loading bar will look more accurate.
@Retr-eo5uz
@Retr-eo5uz 7 лет назад
For bigger games this isn't very good because it gets to fast to 100% and you have to wait then like 10 seconds. Also you are the Unity/Blender/C#/Photoshop God. You are the best !
@firelights3675
@firelights3675 7 лет назад
GamerRO Gameplayer how does it get to 100% too fast? It isn't waiting a certain amount of time, it is actually showing the current state of loading
@Retr-eo5uz
@Retr-eo5uz 7 лет назад
Fire Lights I say that in like 3 second the bar is at 100 then I wait like 20 seconds till the next scene loads
@RTXTi-co8pd
@RTXTi-co8pd 7 лет назад
GamerRO Gameplayer Mabye the game that youre making isnt heavy on resources or you have a very good computer... As Brackeys said the load is two parts,i think those 20 secons are part two
@chaosmongerstudio
@chaosmongerstudio 5 лет назад
I'm having the same problem... Gets super fast to 100% then everything freezes - I've also animations - then I've to wait 10 seconds before the scene actually loads.
@SaifUlIslam-db1nu
@SaifUlIslam-db1nu 5 лет назад
I watched two continuous adds for you, and I'll watch more if it means that I have to learn everything you can teach. So, thank you. :)
@47Mortuus
@47Mortuus 4 года назад
Read a book and stop wasting your time
@wyattsilket8457
@wyattsilket8457 4 года назад
@@47Mortuus damn, you really gotta be a bitch like that
@47Mortuus
@47Mortuus 4 года назад
Convince me that watching ads is not a waste of time. I'm very curious.
@47Mortuus
@47Mortuus 4 года назад
@XboxPro39 Saying that you prefer to waste time instead of learning doesn't make a waste of time not a waste of time.
@47Mortuus
@47Mortuus 4 года назад
@XboxPro39 Yes, boi
@matymdatango
@matymdatango 7 лет назад
Love your videos, keep it up! pd: Can you make a video explaining procedural animations in unity 2D?
@oldmandougboy8050
@oldmandougboy8050 7 лет назад
matymdatango I need this please do it!!!
@anmolmohanty4806
@anmolmohanty4806 5 лет назад
Be
@BatMan-pb4sc
@BatMan-pb4sc 7 лет назад
Can we also make a delay? Like wait 5 Sec. before entering he next scene?
@programmergirlqueen8393
@programmergirlqueen8393 4 года назад
thats what im seraching too
@ZombieStudios
@ZombieStudios 6 лет назад
my loading bar didnt load, it just stayed at 0, this is my code using System.Collections; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class LevelLoader : MonoBehaviour { public GameObject loadingScreen; public Slider slider; public Text progressText; public void LoadLevel(int sceneIndex) { StartCoroutine(LoadAsynchronously(sceneIndex)); } IEnumerator LoadAsynchronously(int sceneIndex) { AsyncOperation operation = SceneManager.LoadSceneAsync(sceneIndex); loadingScreen.SetActive(true); while (!operation.isDone) { float progress = Mathf.Clamp01(operation.progress / .9f); slider.value = progress; progressText.text = progress * 100f + "%"; yield return null; } } }
@bigemil9817
@bigemil9817 4 года назад
@Brackeys they removed it from the Asset Store and i need it :(
@omayoperations8423
@omayoperations8423 4 года назад
removed what?
@bigemil9817
@bigemil9817 4 года назад
@@omayoperations8423 the asset
@a7_blockeyblue529
@a7_blockeyblue529 4 года назад
How would I go about making the scene thats loaded be determined by a variable. instead of using "(string _________)" how would I turn that into loading off of a variable that has the scene name in it. I am using this for a pause menu, so when I hit back to game, it only takes me to the scene that is set, so if I am on level 2, and I go into the pause menu, pressing back takes me to level 1. Any help?
@rrrush
@rrrush 6 лет назад
For those of you who want the loading to begin without a button, heres the script. follow the steps in the video , except the ui button part, and you should be good;) using System.Collections; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class LoadingScreen : MonoBehaviour { public GameObject loadingScreen; public Slider slider; public Text progressText; public int loadSceneIndex = 0; void Start() { StartCoroutine(LoadAsynchronously(loadSceneIndex)); } IEnumerator LoadAsynchronously (int sceneIndex) { AsyncOperation operation = SceneManager.LoadSceneAsync(sceneIndex); /////////IT WORKS !!!!!!! loadingScreen.SetActive(true); while (!operation.isDone) { float progress = Mathf.Clamp01(operation.progress / .9f); slider.value = progress; progressText.text = progress * 100f + "%"; yield return null; } } }
@LoOnarForge
@LoOnarForge 6 лет назад
As always fantastic tutorial, thanks Asbjørn! Quick question to anybody: I am using "allowSceneActivation = false" to stop next level from loading until player presses "Continue" button. What I have noticed that button not always reacts( I can see that button goes dark for a moment but function assigned to it is not being called, sometimes I have to press it three times). It is an exact same button like another 20 in my game and they work 100% of a time, always on the 1st click. I am wondering if maybe coroutine is messing up the input? It is mobile, Android game. Anybody has the same problem maybe? It is not a big problem but still.
@LoOnarForge
@LoOnarForge 6 лет назад
It seems that minimizing the app makes this happen more often.
@moosesnWoop
@moosesnWoop 3 года назад
Anyway that I can remove the decimals from the progress Text? I have like 5 numbers after the decimal and it looks crappy.
@ajglobalnet
@ajglobalnet 3 года назад
same
@moosesnWoop
@moosesnWoop 3 года назад
@@ajglobalnet I figured it out but now I can't remember. It's actually simple enough - I think it's actually in the code itself
@playbestgames6819
@playbestgames6819 4 года назад
Hi Brackeys, I tried to use your code with onEnable() instead of button click but it seems the scene starts loading right away. On Android it doesn't even show loading bar, it just delays the load and shows the second scene straight away. Do you think allowSceneActivation = false; will help or there is something else to add to make it work properly?
@Demon.Immortalis
@Demon.Immortalis 2 года назад
The legend who left...
@Natylu1000
@Natylu1000 2 года назад
It works perfectly, thank you soo much! + 1 Like; + 1 Subscribe;
@lemonaise_
@lemonaise_ 4 года назад
please could anyone help? Mine doesn't return any errors, it just doesn't work. It simply freezes at 0%,waits for the level to load, and then turns into the next scene, instead of actually loading. I copied his code exactly, help?
@harshonthego
@harshonthego 6 лет назад
Perfectly done that but in middle of my loading no. Are always in point values likr 47.669999 % and then 100% How to only allow roundoff no.
@wcamicase_gaming
@wcamicase_gaming 6 лет назад
I'm having the same issue.
@SolarAnomaly
@SolarAnomaly 6 лет назад
Do this: (int)(progress*100f)+"%"; instead of just progress*100f + "%";
@andreireinhardclemente3234
@andreireinhardclemente3234 5 лет назад
@@SolarAnomaly Thanks a lot it helps :)
@AobaSanJin
@AobaSanJin 5 лет назад
@@SolarAnomaly Thanks man you saved me.
@fasihali2146
@fasihali2146 6 лет назад
operation.progress always gives 0 can anyone help? :(
@florinmanolache9706
@florinmanolache9706 6 лет назад
any solution?
@Triggerly
@Triggerly 4 года назад
maybe it's too fast
@sahka
@sahka 4 года назад
loadingScreen.SetActive(true); but setactive is error! my code: using System.Collections; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class LevelLoader : MonoBehaviour { public GameObject loadingScreen; public Slider slider; public void LoadLevel (int sceneIndex) { StartCoroutine(LoadAsynchronously(sceneIndex)); } IEnumerator LoadAsynchronously (int sceneIndex) { AsyncOperation operation = SceneManager.LoadSceneAsync(sceneIndex); loadingScreen.SetActive(true); while (!operation.isDone) { float progress = Mathf.Clamp01(operation.progress / .9f); slider.value = progress; Debug.Log(progress); yield return null; } } can someone help me with this problem?