Unity Keeps Crashing

Hi, I’m using the 2019.4.20f1 release of Unity 3D, and my project keeps crashing. When I first open up the editor, everything is fine, but if I select a Game Object, and click on a certain value in a script, the editor freezes and eventually crashes. I have tried restarting my computer and reducing the CPU cores Unity uses, but nothing works.

I am using Windows 10 and my Laptop specs are:

CPU: Ryzen 7
Graphics card: Radeon Vega Mobile
RAM: 16 GB

I have been using Unity for 6 months and have never experienced a problem like this.

Thank you.

some unity versions will crash if certain errors in the code are present. I don’t recall which specific errors I’ve had on my project but it happened to me also. I think infinite loops may be some of these errors that unity can’t handle.

normally unity will inform you the code have errors and will disable the script and will refuse to enter the play mode. but it will not crash.

but sometimes the editor will just crash.

with the editor closed navigate to the place where you have the script attached to the gameobject and do one the followings, open it and try to figure out if you have errors and fix them. or remove the script from the project.

Thank you very much dorusoftware! I rewrote the script and it is now working.