how to find go by guid

Started by k0fe 8 posts 510 views

Reply on sbox.game
  1. #1
    k0fe 318
    how would you approach at finding gameobject only having its guid?
    image.png 24.55 KB
  2. #2
    Zontax 8,642
    Scene.Directory.FindByGuid() ?
  3. #3
    k0fe Started this 318
    Can I search by GUID in the scene for example? As a developer? 

    I went through manually searching through scene using text editor 
  4. #4
    Lorenz Facepunch 2,160
    Have you tried what Zontax said? that should work 

    Scene.Directory.FindByGuid("c14e7405-86e3-4e4a-afb6-0c6ccd765888");
  5. #5
    k0fe Started this 318
    Yeah, my point was if it's possible to do so without writing code? In some cases you just find a gameobject with specific components or even guid (this one should not happen really)
    Was curious if there such functional in the search bar or any other way

    FindByGuid is a viable option when we work with code, for sure. Thanks for going an extra mile and even putting the right GUID in the code snippet, appreciate the effort
  6. #6
    Lorenz Facepunch 2,160
    Ahh I see. Well we could definitely add that ability to the scene search bar.
    Could you create an issue on github for that?
  7. edited Apr 2025 #7
    k0fe Started this 318
    edited:
    You can search by guid by typing id: before your guid in the search bar. E.g id:86378aba-add8-4a01-ae87-7b9c0688f038 .

    - badandbest
  8. #8
    badandbest 575
    You can also search by components with t:. E.g t:SkinnedModelRenderer

    And by tags with tag:. E.g tag:trigger.