Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

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

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

  1. Pathojen

    Pathojen

    Joined:
    Feb 4, 2019
    Posts:
    164
    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:
    4,515
    Some tertiary googling tells me this feature does in fact, already exist. Perhaps try the same.
     
  3. SunnySunshine

    SunnySunshine

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

    Pathojen

    Joined:
    Feb 4, 2019
    Posts:
    164
    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:
    2,460
    search in the hierarchy: „t:AudioListener“
     
    DragonCoder likes this.
  6. Pathojen

    Pathojen

    Joined:
    Feb 4, 2019
    Posts:
    164
    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: Mar 21, 2023
  7. Ryiah

    Ryiah

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

    Pathojen

    Joined:
    Feb 4, 2019
    Posts:
    164
    I double-clicked and nothing happened.
     
  9. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    18,916
    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:
    4,515
  11. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,829
  12. Pathojen

    Pathojen

    Joined:
    Feb 4, 2019
    Posts:
    164
    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:
    4,515
    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,303
    @Pathojen please post screen shots and Unity version, as you must be doing something wrong.
     
  15. Pathojen

    Pathojen

    Joined:
    Feb 4, 2019
    Posts:
    164
    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:
    44
    Ryiah likes this.
  17. sebastienp_unity

    sebastienp_unity

    Unity Technologies

    Joined:
    Feb 16, 2018
    Posts:
    137
    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 Pathojen like this.
  18. Pathojen

    Pathojen

    Joined:
    Feb 4, 2019
    Posts:
    164
    That feature could save people from scrapping whole projects over errors about missing items. Will try it out.