Find ALL game objects containing the same scrip


Is it possible to find ALL game objects containing the same script in my project, or does anyone know of a pug in ?

The reason I ask is over the years if created so many scripts and I’m sure some of them now are not needed or used by any game object so would like to delete them because I’m on a quest to clean up my project.


You can use the Static function FindObjectsOfType from the class Object. This finds only objects in the Scene basically, or did you want a way to find prefabs which use the script as well?

Then there is this: Find All Assets by Type - Unity Answers

There is another method.

Back up your project. Delete the scripts. See what breaks.

Not saying its a good solution.