Reload Script Assemblies upon every Play/Stop in empty project

I want to raise the issue of “Reload Script Assemblies” popup again. It turns to really critical one.
In my case, almost clean (1 script) project popups up “Reload Script Assemblies” popup every time I enter Play mode. (attaching GIF)

Though there is a related thread devoted to discussion of increased compilation times “when changing one C# script”

The issue seems to be more critical

7785414--982686--2022-01-06_15h35_34.gif

If you go into Project Settings > Editor > Enter Play Mode Settings you can turn off Domain Reload. Play becomes instant.

11 Likes

It’s turned off

7785483--982704--2022-01-06_16h02_00.gif

1 Like

No, you have to turn on “enter play mode options” to have the option to turn it off fire. So turn on the first toggle.

That’s… I hadn’t thought about it before, but yeah the menu design there is pretty awful.

15 Likes

Oh yeah! It helped! Thanks! And yes, the design is terrible! How can one guess it?

2 Likes

i need to change it on every new project, why is that.

Because Project Settings, as the name implies, are per-project.

2 Likes

I wish people would stop mentioning the Domain Reload skip function. It introduces so many bugs and breaking plugins that hard to indentify and out of the sudden you remember “wait, ive set this toggle someone in the forum told me about”

I ve spent hours figuring out why my physics went crazy but only on the second startup until i remembered i set those toggles to true

really, read the docs first!:

9 Likes

I haven’t found away to stop the rebuilding other than Domain Reload skip. Thanks for the warnings though, didn’t know skipping Domain Reload caused other issues.

If I modify scripts as suggested in the manual is that enough? Are there other unintended issues that arise?

It’s not very hard to work with if you understand what it does and why.

The big problem is if you’ve either got an old project with some gnarly coding practices that makes it hard to deal with, or if you’re importing a lot of code from the asset store and/or online tutorials that doesn’t support the feature.

2 Likes

So basically we are again stuck with compatibility issues and long editor play wait times even for smaller projects? Thanks unity… again

2 Likes

I still don’t know a proper solution, but I noticed when you have one of your scripts open from the project in a code editor, if you get the ‘reloading script assemblies’ bar stuck, just save that script without any changes while that happens and playmode starts working. Worked every time so far but yeah, not a solution or anything.

Issues do occur when I open other people’s projects, be it demos or tutorials or otherwise.

I’ve not run into issues with Domain Reload Disabled in projects that I create, not even with assets/packages so far. This may be because I only use quality assets/packages, it’s rare for me to use an asset that hasn’t been updated in the past 12 months. Even so, it’s only a matter of checking for any “static” field and if there is such an instance, adding a
(Runtime)InitializeOnLoadMethod that sets the static fields to null or new(). I think I’ve had to do this maybe once or twice this year.

Given that this option saves me a lot of time when iterating, I always make sure it works. It also forces me to re-think whether I really need a static here.

1 Like

Awesome! Instant play mode. Thanks buddy.

I’m confused with this. Apart from this forum thread, Google results show only people complaining about having this Reload Script Assemblies loading “when they change a script” (which sounds fine to me).
Nobody ever mentions having it every single time they hit Play.
So is this a bug, a weird setting I activated somehow?

Yes this is normal, and yes you can turn it off. The post above yours is quoting how to turn it off.

Yes but it also breaks everything relying on static variables being reset between sessions.
I’m 100% certain that this reloading was not there 1 year or 2 ago.
Plus, what’s the logic of reloading script assemblies when no script has been modified anyway??

Then don’t over rely on static values or make sure your static classes reset when play mode is exited. It’s pretty easy to do.

It’s always been there. Just newer version of Unity show an actual popup rather than the editor just hanging.

It’s not just reloading script assemblies, it’s a domain reload, which involves more than just compiling scripts.

1 Like

Turn it on to turn it off :smile:
Thanks for the note!