Thank you a lot! Even though I have some programming experience, by watching this video, I was able to see that I had an infinte while loop lol. Thank you :)
Thanks you a lot! You saved my time, my nerves and my will to develop games! I had a problem with a do-while cycle and my game froze editor. After your video, I set up visual studio for debugging and paid attention to the only one cycle I had in my code and that was the point. Thank you a lot for your video!
Extra Tip: If you don't know where to put your breakpoint, then you should be able to push the "Pause" button on the debugger control in visual studio. This will cause the debugger to freeze on whatever piece of code is currently being executed, which should be within your infinite loop (assuming that's actually your problem of course!)
@@yees_7568 At 3:05 he attaches the debugger to unity, you can see at the top of the VS interface a control with three buttons: One with 2 vertical lines (pause), a red square button (stop) and a circle with an arrow in it (restart). It's just below and to the right of the HELP menu. Once you have launched your app in Unity and gotten it to freeze, go back to visual studio and click that pause button with the two vertical lines.
I waited to long to close unity in my task manager after I got this error and my pc is freezing and it’s about 1 frame per minute I’m gonna have to close my whole pc and probably lose hours of work
I stumbled here, thinking something wrong with my Editor, and when you've mentioned the infinite while-loop it hit me that I've just added one such loop in a coroutine, and forgot the yield return null! Thanks for the enlightenment.
hello i have a problem with unity. I have reinstalled it 5 times already but it always the result. My unity is just frozen i can click on anything in unity. Like the assets folder, cant create new folders etc. Its just frozen. But when i installed it on my laptop it works with out issue.
Thank you so much. My game freezes only when the turret sees the player. So I know basically where to look but this gave me a game plan. Subscribed and liked :-)
How ironic. Years of using Unity and watching these videos for quite a while but never watched this one. I can't believe I didn't know I could end an infinite loop using this method. 👍
@@TurboMakesGames ryzen 1600, rx5600 xt, 16gb ram 3200. But I think the problem is polybrush, after deleting some of the models I've modified with it the level loaded way faster, and thats a problem because I rely a lot on polybrush...
@@Javierattor Yeah you're computer should be fine. I'm not too familiar with polybrush so I don't know about some of the optimizations you can make for it. Do you have a large number of models or some big and complex ones? I could see how you might run into some performance issues in those cases
@@TurboMakesGames I use it mostly to modify some terrains I made in blender so they don't look all the same without modeling more, maybe there is some weird incompatibility with the export format I'm using and polybrush.
I have a similar issue, except it only freezes when in VR using oculus air link. I can't remember exactly what I did that made this happen. The issue doesn't occur if I run the same scene without a VR headset connected. I can still use the editor freely while in play mode in VR, however, the entire editor freezes when I try to exit play mode.
This also works in Visual Studio Code, just open the project folder and install the "Debugger for Unity" extension, set it up and hit start. If it attaches correctly you can just stop it to exit play mode.
If the editor is frozen because it's stuck in a while loop, you can't exit play mode normally - you have to do some debugging and fix the broken logic before you can exit play mode as you normally would.
@Sports Mania you asked that 3 months ago, but here's your answer anyways. search for your editor's name (like "Visual Studio") in windows's default searcher. if you can't search for some reason, find it's installation folder and start it with its .exe file
Hi, thanks for the video but it does not work for me. When I start Debug I cannot use the steps s icons. Also, I cannot change a bool like you do . I am under Visual community 2019.
Are you using the C# Job system or some other method of multi-threading? If so debugging might be a bit more complicated than how I demonstrated in this video. Maybe this article will be a good starting point for you: docs.microsoft.com/en-us/visualstudio/debugger/debug-multithreaded-applications-in-visual-studio?view=vs-2019
@@rudragoenka4572 Are you sure you are in Debug mode and it is attached to Unity? If so, has your program hit a breakpoint? If your program hasn't hit a breakpoint, it will just continue running as normal and wouldn't allow you to step through your code
No offense, but if you don't save for 7 hours then guess whose fault this is? I am guilty of it myself. I got a sticker at the top of the monitor to remind me about it.
My case for every while: int whileCount =0; while (your bool || whilrCount>9999) { //your function (); whileCount++; } if(whileCount>9999) Debug.LogError("infinity while");
Ohhhh ohhhh ohhhh my god ohhhhhh I m Indian in 6th I just done while(true) to if (false) love from India thankest thank uuuuuuuuuu thank uuuuuuuu I was trying full 4 hours and I got this but my scored stopped becuz of restart button😭😭
Haha glad to hear this helped you fix the problems you were having! It's often something simple but it can be tough to track down sometimes especially when the game is freezing.
Very helpful, saved me a lot of time trying to figure out what could have been causing my game to freeze, thanks again!
Glad this video helped you out!!
Thank you a lot! Even though I have some programming experience, by watching this video, I was able to see that I had an infinte while loop lol.
Thank you :)
Nice! Glad you got that all sorted out
Thank you dude , You actually saved my life, years of planning and a whole population ,you're a hero
😆😆😆Love it!
Also, can freeze if in your project settings time -> timescale is set to 0. No time passes so most things are frozen. Set it to 1 to fix.
Thanks you a lot! You saved my time, my nerves and my will to develop games! I had a problem with a do-while cycle and my game froze editor. After your video, I set up visual studio for debugging and paid attention to the only one cycle I had in my code and that was the point. Thank you a lot for your video!
Hah, nice - glad this helped you figure that out. Keep learning and creating!
Best thing Ive learned all month. Realize I should probably learn how to use visual studio before unity - lol - thanks man.
Glad this helped!! You'll learn more about Visual Studio as you go along, the important part is that you are making games 😀
Thank you so much! I thought I had to delete and restart my project again, but you saved me from the trouble! Thanks!
No need! Glad this helped 😊
Extra Tip: If you don't know where to put your breakpoint, then you should be able to push the "Pause" button on the debugger control in visual studio. This will cause the debugger to freeze on whatever piece of code is currently being executed, which should be within your infinite loop (assuming that's actually your problem of course!)
where is the debugger control?
@@yees_7568 At 3:05 he attaches the debugger to unity, you can see at the top of the VS interface a control with three buttons: One with 2 vertical lines (pause), a red square button (stop) and a circle with an arrow in it (restart). It's just below and to the right of the HELP menu.
Once you have launched your app in Unity and gotten it to freeze, go back to visual studio and click that pause button with the two vertical lines.
@@tombird6592 oh, thanks
Indeed! Thanks for mentioning it 😊
Thank you veryy much! You saved my project. I was going crazy. Couldnt figure out where the loop was. Finally found out.
U are life saver u have saved my 24 of work I doing straight 24hours making game man I can't tell u how helpful is the video is he deserve 1B subs
So glad to hear this saved your work 😀
Don't worry, I'll be at a billions subs soon 😁😂😂
I though I needed to upgrade my PC, thanks for saving me so much money and time. Total life saver
Hah, glad to hear your PC is still good to go!
I waited to long to close unity in my task manager after I got this error and my pc is freezing and it’s about 1 frame per minute I’m gonna have to close my whole pc and probably lose hours of work
Thank you this was the first time I've had an infinite while loop and I was really confused but you helped me a lot!
Nice, glad this helped you out 😀
I stumbled here, thinking something wrong with my Editor, and when you've mentioned the infinite while-loop it hit me that I've just added one such loop in a coroutine, and forgot the yield return null! Thanks for the enlightenment.
Nice, glad to hear you figured that out! I've definitely done that myself 😂😂
The thing with me is that I didnt even press play.
first time a tutorial has saved me from having to close a program and lose my work!
So awesome to hear this!!
Thank you very much! You saved me from digging through the whole code! :D
Nice! Glad to hear this worked out for you
Worked for me! Thanks Turbo!
Awesome, glad to hear it!!
hello i have a problem with unity. I have reinstalled it 5 times already but it always the result. My unity is just frozen i can click on anything in unity. Like the assets folder, cant create new folders etc. Its just frozen. But when i installed it on my laptop it works with out issue.
You just saved my class project, thank you.
Great to hear! Best of luck with your class project 😀
Thank you so much. My game freezes only when the turret sees the player. So I know basically where to look but this gave me a game plan. Subscribed and liked :-)
Oh cool, glad to hear this helped get you looking in the right direction. All the best with resolving that issue!
How ironic. Years of using Unity and watching these videos for quite a while but never watched this one. I can't believe I didn't know I could end an infinite loop using this method. 👍
Hah, well hope it works out for you if you need it!
I removed every script from my project and it stills stops responding/takes forever to load, save or enter play mode.
How old is your computer? Is your computer just having a hard time running Unity? Might be worth trying to reinstall Unity also
@@TurboMakesGames ryzen 1600, rx5600 xt, 16gb ram 3200. But I think the problem is polybrush, after deleting some of the models I've modified with it the level loaded way faster, and thats a problem because I rely a lot on polybrush...
@@Javierattor Yeah you're computer should be fine. I'm not too familiar with polybrush so I don't know about some of the optimizations you can make for it. Do you have a large number of models or some big and complex ones? I could see how you might run into some performance issues in those cases
@@TurboMakesGames I use it mostly to modify some terrains I made in blender so they don't look all the same without modeling more, maybe there is some weird incompatibility with the export format I'm using and polybrush.
Oh my god, you just saved me hours of rework! You sir, are a hero.
That's so great to hear 😀
unluckily my visual studio was not on the screen. I did not do code.
Thank you so much for this tutorial! You saved me from losing a whole chunk of my work lol
Nice! So glad to hear this 😊
It’s not good, I haven’t saved for
hours
I love unity so much I’m gonna have to make my games main menu all over again
i almost didnt submit my finals all thanks to you sir
Glad you got it submitted!!
I have a similar issue, except it only freezes when in VR using oculus air link. I can't remember exactly what I did that made this happen. The issue doesn't occur if I run the same scene without a VR headset connected. I can still use the editor freely while in play mode in VR, however, the entire editor freezes when I try to exit play mode.
This also works in Visual Studio Code, just open the project folder and install the "Debugger for Unity" extension, set it up and hit start. If it attaches correctly you can just stop it to exit play mode.
Thanks for sharing!
@@TurboMakesGames No problem, thanks for the video! :D
Isn't it any way to get out of play mode in Unity if the editor is stucked in the while loop?
If the editor is frozen because it's stuck in a while loop, you can't exit play mode normally - you have to do some debugging and fix the broken logic before you can exit play mode as you normally would.
@Sports Mania you asked that 3 months ago, but here's your answer anyways. search for your editor's name (like "Visual Studio") in windows's default searcher. if you can't search for some reason, find it's installation folder and start it with its .exe file
Thanks! This saved me was a great debug 101, which I was afraid of tackling.
Great to hear, glad you got some good results from it!
i delete the scripts to my project but the freez in play mod still continue .how can i resolve this probleme ?
how i do if i dont have the button?
Help when I attempt to make it false it says this vale could not be seg
thank u so much this video literally save me months of headaches, ty again!!!
So glad to hear this helped you out so much 😀
what are the other possible reason for freezing? I can't find any loop in update()
I figured it out, I was making a number divided by 0 in update and using that number in a lerp function...
Thanks for the update, glad you figured it out!!
Hi my problem is when I can click play my code doesn't run even thought my code is good.
Thanks man, awesome vídeo, helped me a lot!!
Awesome, so glad to hear that!
Hi, thanks for the video but it does not work for me.
When I start Debug I cannot use the steps s icons.
Also, I cannot change a bool like you do .
I am under Visual community 2019.
If I make pause to Debug it says that the code is not compatible... "Debug does not take this with threads" but I have a quad core what the hell ?
Are you using the C# Job system or some other method of multi-threading? If so debugging might be a bit more complicated than how I demonstrated in this video. Maybe this article will be a good starting point for you: docs.microsoft.com/en-us/visualstudio/debugger/debug-multithreaded-applications-in-visual-studio?view=vs-2019
Thanks bro. I manage to fix it. I had the same while loop
Right on, cheers!
How did you open visual studio?
Saved my life, bro
Haha awesome to hear!
This helped me a lot thankssss
Nice, glad to hear this helped you out!
the problem is i dont have the script open
Damn, I can't seem to find this in VS Code, I guess I'll finally give in and change over to VS Studio.
Or better yet, upgrade to JetBrains Rider 😁 - it's a paid software but worth its cost many times over IMO
Thank you so much , you solved my save
Nice, glad to hear you recovered it!
I am unable to select the step into function .Pls help me
Why isn't it letting you step into a function?
@@TurboMakesGames idk why
@@rudragoenka4572 What happens when you try?
@@TurboMakesGames I see the button but it is black and white and when I press f11 nothing happens
@@rudragoenka4572 Are you sure you are in Debug mode and it is attached to Unity? If so, has your program hit a breakpoint? If your program hasn't hit a breakpoint, it will just continue running as normal and wouldn't allow you to step through your code
It won't let me step
Very helpful. saved me
Awesome to hear that!
unity fixed itself while I was watching this video, so thanks I guess?
But it's great to have that knowlede! Thank you again!
😂😂 Glad I could help!
Thank you so so much!
Absolutely, glad it worked out for you!
A live saver, thank you!
Glad to help!
Can you use an break;" ?
Yes you can!
Thankyou so much man!!!
You got it!!
Thanks, bro you saved me...
Great to hear this helped you out!
Great very helpful.
Nice, great to hear!
Tnx bro you help me and with an easy method 🙏
Niiiice! Glad to hear this worked for you 🙌
Unity really be like “hmm he defintley didn’t want 7 hours of work saved let’s delete it wtf I hate my life
No offense, but if you don't save for 7 hours then guess whose fault this is? I am guilty of it myself. I got a sticker at the top of the monitor to remind me about it.
Even fucking roblox studio is better at saves. Unity needs some cloud storage thingy that has autosaves on it.
I knew my code had something to do with the freezing so I closed my Visual Studio. Dang.
Dang, at least you'll know for next time!
You save me bro tnx very much
Glad I could help 😊
I did that and my unity crashed ;-;
Oh no 😲
Hope you didn't lose too much work!
@@TurboMakesGames like 20m of work but that's ok
My case for every while:
int whileCount =0;
while (your bool || whilrCount>9999)
{
//your function ();
whileCount++;
}
if(whileCount>9999)
Debug.LogError("infinity while");
THANKS
You got it!
thxxxxxxx so much
No problem!
Thank you
Oh yeah yeah
the meme has been dead for 2 years...
thx
Sure thing!
Thank you ...
Happy to help!
i cant open VS lol
thaaaaaaaaaaaaaaaaanks
Ohhhh ohhhh ohhhh my god ohhhhhh I m Indian in 6th I just done while(true) to if (false) love from India thankest thank uuuuuuuuuu thank uuuuuuuu I was trying full 4 hours and I got this but my scored stopped becuz of restart button😭😭
Haha glad to hear this helped you fix the problems you were having! It's often something simple but it can be tough to track down sometimes especially when the game is freezing.
I will subscribe if this works lol
Well, did it work?? 😁😂😂
Thankyou so much. Really helpful
Awesome, glad it helped!