Game development takes a long time. So any little thing you can do to save time is (usually) worth it. Earlier this week I came across this tip that allows you to enter play mode faster in Unity. I tried it out and it works. But I wanted to know WHY it works, too. So I spent some time figuring it out. And now, I’ll share it with you.

Configure Unity Enter Play Mode Settings

To configure the Enter Play Mode settings for your Unity project, we’ll need to go into the project settings for the Editor. This can be found on the main menu bar under: Edit > Project Settings > Editor.

Down near the bottom of this panel, there is section titled “Enter Play Mode Settings”. Under this is a single item: “Enter Play Mode Options”. This is (likely) disabled, meaning that it will use Unity’s default settings surrounding play mode. Click the checkbox to enable you to configure the settings yourself.

Two options should appear below “Enter Play Mode Options”: Reload Domain and Reload Scene. Leave these two options unchecked.

Your final settings should look like this:

Why Configuring Unity Enter Play Mode Settings Works

Every time you enter Play Mode from the Editor, Unity does two things. (Note, paraphrasing here.)

First, Unity does what is called a “domain reload”. This creates a backup of all your C# scripts, unloads all the original ones, and creates new ones specifically for this one instance of Play Mode.

Second, Unity destroys the scene entirely and loads it from scratch.

The two settings we configured allow you to change that slightly. Instead of creating backups of all your scripts each time, you just use the script itself. And instead of completely destroying the scene and reloading, you just simulate that and reset everything back to default position/settings. (This is the Application.Reload bar you sometimes see pop up.)

How Much Time Does Configuring Unity Enter Play Mode Settings Save?

This is completely dependant on the size of your Unity project, of course. But just out of curiousity, I did some testing of my own.

On average, my computer takes about 4-5 seconds to start Play Mode in a empty Unity project. Enabling these settings takes that time down to nearly instant.

Last night, I was developing a new tool and entered Play Mode about 50 times over the course of the night (roughly 3 hours). And I would say that’s a good average for me. (Depends on how much time I have for game development on any given day.)

Multiplying that out, 5 seconds saved x 50 times = 250 seconds. Divide by 60 seconds and you get roughly 4 minutes saved. Doesn’t seem like much in the grand scheme of things. But what about over an entire year?

If you work on your game every day for an entire year, that 4 minutes x 365 days = 1460 minutes saved. Divide by 60 gives you a little more than 24 hours saved. More than an entire day!

And this is just with an empty Unity project. The larger your project and the more people you have working on it, the more time this little trick can save you.

Disclaimer

As cool as this trick is, it isn’t practical in all situations. There are some cases where scene and domain reloading are necessary. There is a lot going on under the hood of those processes.

As a general rule, using this trick in the early development stages of your project should be fine. Once you near the end of production, you may need to turn it off. I recommend checking out the Unity documentation. Learn as much as you can about the process so you can make the right decision for your project.

Conclusion

Configuring the Enter Play Mode settings for your Unity project helps save time. It isn’t hours a day (I wish!). Honestly, it’s barely noticeable. But it over time it definitely adds up. Try it out in your Unity projects.

Have you used the Enter Play Mode settings in your Unity projects? Have time saving tips of your own? Be sure to share your experience with us in the comments below. I’m especially curious if you’ve had times you had to turn domain/scene reloading on.

Categories: Unity