Unity Error Decoder: Paste a Stack Trace, Get the Fix
Unity error messages tell you what went wrong but rarely why, and almost never in what order to check things. Paste the message or the whole stack trace and this page will match it against every error we have documented. Each error then has its own page with the causes ranked by how often they actually occur, the specific fix for each one, and the version differences where they matter. Matching runs entirely in your browser, so nothing you paste is uploaded.
Paste your error
Paste the error message or the whole stack trace from the Unity Console. Matching happens in your browser; nothing is uploaded.
Runs in your browser. Nothing is uploaded.
Results appear here as you paste.
Every error, by category
12 errors documented so far.
Runtime exceptions
Thrown while the game is playing, in the Editor or in a build.
- Scene not in build settings
Scene 'X' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.
Why Unity says a scene has not been added to the build settings, including the case where the scene is already in the list. Six ranked causes with fixes.
- NullReferenceException
NullReferenceException: Object reference not set to an instance of an object
Why Unity throws NullReferenceException, how to read the stack trace to find the exact line, and the five causes that account for nearly all of them.
- MissingReferenceException
MissingReferenceException: The object of type 'X' has been destroyed but you are still trying to access it.
Why Unity says an object has been destroyed but you are still accessing it, how destroyed objects differ from null, and the four causes worth checking.
- UnassignedReferenceException
UnassignedReferenceException: The variable 'X' of 'Y' has not been assigned.
Why Unity says a variable has not been assigned, including the case where you did assign it, and how prefabs and scene references cause it.
- Coroutine couldn't be started
Coroutine couldn't be started because the game object 'X' is inactive!
Why Unity refuses to start a coroutine on an inactive GameObject, including the case where the object looks active, and what to use instead.
- Look rotation viewing vector is zero
Look rotation viewing vector is zero
Why Quaternion.LookRotation warns that the viewing vector is zero, the four ways a direction ends up zero length, and how to guard against it cleanly.
- Non-convex MeshCollider
Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported since Unity 5.
Why Unity rejects a concave MeshCollider on a moving Rigidbody, what PhysX can and cannot simulate, and the four ways to get the collision you wanted.
Compiler errors
Reported by the C# compiler. Nothing runs until these are cleared.
- CS0246: CS0246
error CS0246: The type or namespace name 'X' could not be found (are you missing a using directive or an assembly reference?)
Why Unity reports CS0246, ranked by how often each cause occurs, including assembly definitions, Editor folders and knock-on errors from elsewhere.
- CS1061: CS1061
error CS1061: 'X' does not contain a definition for 'Y' and no accessible extension method 'Y' accepting a first argument of type 'X' could be found
Why Unity reports CS1061, from typos and wrong types to private members and renamed APIs, with the fix for each and how to read the message.
Editor errors
Raised by the Unity Editor itself, usually about a broken reference.
- Referenced script is missing
The referenced script on this Behaviour (Game Object 'X') is missing!
Why Unity reports a missing script on a GameObject, how to find which object it is, and the five causes from deleted files to broken .meta GUIDs.
- Script class cannot be found
Can't add script component 'X' because the script class cannot be found. Make sure that there are no compile errors and that the file name and class name match.
Why Unity refuses to add a script component, ranked from compile errors and name mismatches to namespaces and abstract classes, with the fix for each.
Build errors
Raised while packaging a player, and often platform specific.
Built by David Edgecombe at Ocean View Games, a Unity studio in London.
Frequently asked questions
Does my stack trace get uploaded anywhere?
Why does it show several possible matches instead of one answer?
My error is not listed, so what should I do?
How do you decide what goes on each error page?
Why does pasting the whole stack trace work better than the first line?
Last updated: