- Home /
How to find out which gameobject is a script attached to?
I wrote a script call gamegui.cs, just forgot where I attached it to, it must be somewhere coz its functioning, Is there a good way to find out where it's attached?
thanks very much~~
FYI, you have to type the name of the script exactly, $$anonymous$$us the extension (.cs or .js). You can also put a 't:' in front of the script name if you want to exclude gameObjects with that name (t for type).
Answer by Landern · Mar 15, 2013 at 06:38 PM
You should be able to find the references in the scene.
Find the Script in the project pane, right click it, click on Find References in Scene.
It should highlight the objects in the scene, it will also populate some text in the search textfield in the hierarchy window/pane

Answer by robertbu · Mar 15, 2013 at 05:45 PM
On the Hierarchy pane, there is a search box just opposite "Create." Type in the name of your script.
Holy Fuck.
@Robert - I had absolutely on idea you could type a scrpt name in
Hierarchy
and it would find game objects, with that component.
I knew you could do that in the Projects panel .. had no clue you could do that in Hierarchy
That is ..... amazing.
i don't know what to say - that's the most useful thing, anyone has ever told me - ever - in any situation. Whoa!
Your answer
Follow this Question
Related Questions
Access to variables from other script objects 3 Answers
Enter Class(method) with a script, attached to another Object 2 Answers
Referencing non static variables from another script? C# 2 Answers
I need help instantiateing a bullet 0 Answers
way to get all object with a certain component/script attached 3 Answers