Search Unity

Feedback I wish the editor allowed me to search for game objects with specific components.

Discussion in 'Editor & General Support' started by Deleted User, Mar 21, 2023.

  1. Deleted User

    Deleted User

    Guest

    Suppose you accidentally have two audio listeners, and your warning doesn't even tell you where they are? Or you get an error claiming a script is missing, but it never gives you the name of what it's missing on.

    Anyone else think there should be a way to actually type in components in the editor to show where they are being used?
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,797
    Some tertiary googling tells me this feature does in fact, already exist. Perhaps try the same.
     
  3. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    976
    I think you can just click the error message and it highlights the game object.
     
  4. Deleted User

    Deleted User

    Guest

    The 2 audio listeners one does not.

    I only see this feature for coding in game, not for in editor.
     
  5. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,797
    search in the hierarchy: „t:AudioListener“
     
    DragonCoder likes this.
  6. Deleted User

    Deleted User

    Guest

    How did that work? Why didn't it work all day, then?

    Still, it doesn't show where missing scripts are, even in the error.
     
    Last edited by a moderator: Mar 21, 2023
  7. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,111
    Open the console. Enable warning messages. Hit play. Wait for it to appear. Double-click it.
     
    ippdev likes this.
  8. Deleted User

    Deleted User

    Guest

    I double-clicked and nothing happened.
     
  9. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,111
    It selects the game object that has the component with the missing script. I tested it just before I posted.
     
  10. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,797
  11. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,051
  12. Deleted User

    Deleted User

    Guest

    It directs me to Sample Scene- the root of the entire scene. That can't be right.
     
  13. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,797
    You've still been shown multiple other effective ways to find specific components in the scene.
     
  14. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,768
    @Pathojen please post screen shots and Unity version, as you must be doing something wrong.
     
  15. Deleted User

    Deleted User

    Guest

    After double-clicking. Sorry about that wrong post earlier.
     

    Attached Files:

  16. Paul-van-der-Laan

    Paul-van-der-Laan

    Joined:
    Oct 12, 2013
    Posts:
    59
    Ryiah likes this.
  17. sebastienp_unity

    sebastienp_unity

    Unity Technologies

    Joined:
    Feb 16, 2018
    Posts:
    201
    Hi all,

    The Search Window has a new filter that allows you to find missing assets, prefabs and scripts in your scene:

    upload_2023-3-27_10-47-56.png

    Using the Visual Query builder, these queries would look like this:
    upload_2023-3-27_10-51-20.png

    Textual queries would look like this:
    h: missing:asset
    h: missing:any

    These new filters are available in 23.2, 23.1, 22.2. It is not currently backported to 21.3. We are still looking at the impact.

     
    zombiegorilla and Deleted User like this.
  18. Deleted User

    Deleted User

    Guest

    That feature could save people from scrapping whole projects over errors about missing items. Will try it out.