Skip to content

Utilities | Add tool to find broken components or scripts in a scene

Summary

In development (and switching between multiple branches) sometimes references to scripts on gameobjects get lost. These more often than not only get visible when the scene they occur in is included in a build and/or the scene is loaded. To more quickly identify which game objects are broken, implement a tool that checks if any component on any gameobject in a scene is null. If it is, something went wrong and then we can direct the user to that specific game object.

Problem or need

Sometimes stuff breaks and neither reading stack traces nor finding out which gameobject in a scene with >100 objects is broken is fun.

Proposed solution

Implement a quick and dirty check if any component in the scene is null. If it is, write it to the console. This should make identifying broken objects easier.

Alternatives considered

Read Debug.LogWarnings or Stack Traces.

Additional context

N/A