How can I Find All References to an object in the inspector?

I have inherited a huge project in Unity 3.5, which makes heavy use of dragging/picking object references from an object in the hierarchy to some other object in the hierarchy. There is no documentation covering what all objects in the scene are referencing some other given object in the scene, and as I mentioned, the project is quite large - main scene containing about 16k objects.

I need a way to search from the target object to find all other objects in the scene that are referencing it. Obviously, going the other way, the editor will ping the object you’re tying a reference to. However, I’m looking at objects in the hierarchy that need to be investigated, but I can’t easily locate all the things controlling it or interacting with it.

Any technique akin to doing a “Find All References” on an object in C# would be greatly appreciated.

However, I’m looking at objects in the hierarchy that need to be investigated, but I can’t easily locate all the things controlling it or interacting with it.

Hi @KevinW ! I know it might be a bit late, but there’s an elegant solution (an asset) for this.

Its main idea is opposite to Unity’s Select Dependencies feature, yet asset is offering much more (see screenshot below).

Key features:

  1. It shows you particular fields where the asset is used

  2. It allows you to easily replace it

  3. Search for further usages of assets in the results list

Asset Store link:!/content/59997


NOTE: I’m one of the authors of Asset Usage Finder and I will be happy to answer your possible questions on our product

UPDATE: v3.0 was released! More than 20x faster compared to 2.0 version

There’s an ugly way, but it’ll give you every reference, and you can script it to make it a littler easier.

Change Asset Serialization to Force Text (Edit > Project Settings > Editor). You need Unity 4+ or Unity 3.x Pro to do this.

The scene file (.unity) will contain blocks of text like this:

--- !u!1 &1116311739
  - 4: {fileID: 1116311741}
  - 114: {fileID: 1116311740}
  m_Name: Object1
--- !u!114 &1116311740
  m_Script: {fileID: 11500000, guid: 522cee70d3f794241885ec229977790f, type: 3}
  anotherObject: {fileID: 107191716}
--- !u!4 &1116311741

For clarity, I cut several lines. This is a GameObject named “Object1”. It has a fileID of “1116311739”. It also has a script with a fileID of “1116311740”. That script has a field that references another object with file ID “107191716”.

So hopefully this gives you an idea of how you can parse through the .unity file to get a list of all references.

If you only want to go through the GUI, then you can make sure everything is built from prefabs or basic types (textures, etc.). Then right-click on each prefab and select “Find References in Scene” similarly to how it’s described here: NinjaCamp III: What references your assets? | Unity Blog

Or, for something in between, you can use EditorUtility.CollectReferences() but it’ll still take some scripting work. This answer gives an idea of how to go about it.

Ok so I’ve got something that might help with that graphically (attached). It lets you examine the scene objects that selects anything which has a dependency on them (using the “@” button). You need to open the window using

Window > whydoidoit > Recent Selections

Then switch to the Scene Assets tab and open the section for the kind of thing you are looking for etc.

The package is here (should hopefully contain everything): [|22679]


Relevant script here in case it’s of use to anyone who, like me, found this page via Google.

How about using this asset ?


Check out this open source tool ! It is perfect for finding dependencies of an asset and what references it.

Have fun !

I’ve posted the answer here

Dependencies-Hunter can help you with the task of finding references for any asset.
It’s free and open-source. You are welcome to give it a try!