Everything works in Play Mode. You make a build, launch it, and the game freezes on a black screen, a level won’t load, saves vanish or a feature just does nothing. Works in the Editor but not in the build is one of the most frustrating Unity problems, because the Editor hides the difference. This guide shows how to see what the build is actually doing, then goes through the causes that account for nearly all build-only bugs.
Step 1: See the Build’s Errors
Don’t guess. A build writes a log, and a development build can show errors on screen.
- Development Build. In your build profile (File > Build Profiles in Unity 6), tick Development Build. Errors then appear in a console overlay in the corner of the game, and you can attach the Profiler and debugger.
- Player log. Every build writes
Player.log. On Windows it’s in%USERPROFILE%\AppData\LocalLow\<CompanyName>\<ProductName>\Player.log. On macOS,~/Library/Logs/<CompanyName>/<ProductName>/Player.log. On Android, useadb logcat -s Unityor Android Logcat in Unity. - Script debugging. Tick Script Debugging in the build profile and attach your IDE debugger to the running player, the same way you attach to the Editor. The debugging guide covers attaching.
Search the log for Exception and Error. The first one is usually the cause of everything after it.
Scenes Missing From the Build
In the Editor, SceneManager.LoadScene("Level2") works for any scene. In a build, only scenes in the build’s Scene List exist. Missing scenes cause the error “Scene ‘Level2’ couldn’t be loaded because it has not been added to the build settings or the AssetBundle has not been loaded”, and in a non-development build you may just see nothing happen.
Open File > Build Profiles and add every scene to the scene list. Also check that scene names match exactly, including capitals. Scene index 0 is the first scene loaded. The async scene loading guide covers loading by name vs index.
Editor-Only Code and Assets
- UnityEditor namespace. Scripts using
UnityEditorthat aren’t in anEditorfolder or wrapped in#if UNITY_EDITORmake the build fail with errors like “The type or namespace name ‘UnityEditor’ could not be found”. - AssetDatabase at runtime.
AssetDatabase.LoadAssetAtPathonly exists in the Editor. In the build, use serialized references, Resources or Addressables. - Editor-only tags. Objects tagged EditorOnly are removed from builds. If a manager has that tag by mistake, it vanishes.
- Logic in OnValidate or OnDrawGizmos. These never run in builds. Anything that sets up runtime state there works in the Editor only.
- Inspector-assigned data that was never saved. Values set on a prefab in Play Mode were lost; in the Editor you might be testing with a scene that still has them.
Resources, Paths and File Access
File paths are a top cause:
- Assets folder doesn’t exist in builds.
File.ReadAllText("Assets/Data/levels.json")works in the Editor and fails in a build. Put files in StreamingAssets and read them fromApplication.streamingAssetsPath, or reference a TextAsset. - StreamingAssets on Android and WebGL is inside the compressed package or on a server, so
FileAPIs don’t work there. UseUnityWebRequestto read it. - Save files. Write to
Application.persistentDataPath, never to the game’s install folder, which may be read-only. The JSON save system guide does this correctly. - Resources.Load paths are relative to a Resources folder and exclude the extension. They are case-sensitive on some platforms, even when Windows didn’t care in the Editor.
- Backslashes. Build paths with
Path.Combineinstead of hard-coded\.
Execution Order and Timing
The order Unity calls Awake and Start on different objects isn’t guaranteed, and it can differ between the Editor and a build. Code that happens to work in the Editor because script A’s Awake ran before script B’s may fail in the build.
- Initialise yourself in Awake and talk to others in Start. The Awake vs Start guide explains the rule.
- When order really matters, set it in Project Settings > Script Execution Order or use
[DefaultExecutionOrder(-100)]on the class. - Builds often run at a much higher frame rate than the Editor. Code that depends on frame count, or that forgot
Time.deltaTime, behaves differently. Physics tuned with a very low frame rate may also feel different. - Loading is faster or slower in builds. Code that assumes something is loaded “by the time Start runs” may break. Wait for events instead.
Code Stripping and IL2CPP
With IL2CPP (required on iOS, common on Android and consoles) and Managed Stripping Level above Minimal, Unity removes code it thinks is unused. Code only reached through reflection can be stripped, which breaks:
- JSON libraries deserializing types that are never constructed directly.
- Code that finds types by name with
Type.GetType. - Some dependency injection frameworks.
Errors look like MissingMethodException or “no parameterless constructor”. Fixes: add [Preserve] (from UnityEngine.Scripting) to the types or members, add a link.xml file listing assemblies to keep, or lower the stripping level to test whether stripping is the cause.
IL2CPP also doesn’t support some runtime code generation, such as System.Reflection.Emit.
Missing Shaders and Pink Materials
Materials referenced in scenes are included automatically. Shaders you only find at runtime with Shader.Find("Custom/MyShader") aren’t, unless something references them. In the build, Shader.Find returns null and objects turn pink or invisible.
Add those shaders to Project Settings > Graphics > Always Included Shaders, or reference a material that uses them. Shader variant stripping in URP can also remove keyword variants you only enable from code; keep a material that uses that keyword in a scene or a shader variant collection. The pink materials guide has more.
Platform Differences
- Quality settings. The build may use a different quality level than the Editor. Check Project Settings > Quality and the default per platform.
- Input. Touch, gamepads and keyboard layouts differ. Test the actual devices.
- Case-sensitive file systems on Linux, Android and consoles.
- Graphics APIs. A shader that works on DirectX may fail on Vulkan, Metal or WebGL.
- Memory. Mobile and WebGL builds can run out of memory where the Editor had plenty.
💻 Faster builds, faster fixes
Build-only bugs mean lots of builds. A machine with a fast CPU and SSD cuts the wait. See our budget laptop picks for Unity.
Troubleshooting
Black screen on launch
Read Player.log. Common causes are an exception in the first scene’s Awake, a missing first scene in the build list, or a camera that’s disabled in the build.
“Scene couldn’t be loaded because it has not been added to the build settings”
Add the scene to the build profile’s scene list and check the exact name.
Saves work in the Editor but not the build
You’re writing inside the project or install folder. Use Application.persistentDataPath.
Build fails: “The type or namespace name ‘UnityEditor’ could not be found”
Move the editor script into an Editor folder or wrap the code in #if UNITY_EDITOR.
MissingMethodException only in IL2CPP builds
Code stripping removed something used by reflection. Add [Preserve] or a link.xml.
FAQ
Where is the Player.log on Windows?
In AppData\LocalLow under your company and product name, as set in Player settings.
Does a Development Build behave differently?
Slightly. It’s slower and includes extra checks, but logic bugs reproduce the same way, and you get on-screen errors.
Why does my game run faster in the build?
No Editor overhead. If gameplay speed changes, you’re missing Time.deltaTime somewhere.
Should I test builds often?
Yes. A quick build every few days catches build-only problems while the cause is still fresh.
Can I see Debug.Log output in a build?
Yes, it goes to Player.log, and to the on-screen console for errors in Development Builds.
Reader questions
Asked by readers of this article and answered by AI. Behavior can differ between Unity versions, so test in yours.




Leave a Reply