You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
now that owrigidbodys are not unparented until after a frame, most addon paths are wrong (start with body name instead of SolarSystemRoot/whatever_body, and anglerfish are worse) and so search will occur only on the name.
this has already broken some things, such as solar rangers using owlk gameobjects from band together
this can either be fixed by manually checking against those certain paths and making them resolve correctly, or more accurately, by supporting partial paths.
currently gameobject.find does this, but the inactive version does not, and we really should at this point. it wouldnt be that much slower than searching by only name (just get the leaf name and go up the parent or get the root and go down the child. unity docs suggests it does the former idk where i got that from)
we can benchmark this probably
then we can just be exactly the same as gameobject.find except working with inactive objects too.
implementation
top down
find all objects with name path[0]
try transform.find to path[length-1] until it works
or manually traverse down child but i imagine that is slower
bottom up
find all objects with name path[lenth-1]
traverse up
this sounds slower cuz manual traverse
also current implementation is top down already, all thats really needed is making it search all objects instead of just root objects
also this means u can remove the step where it search for object by name. can just do gameobject.find first and if that doesnt work do this good way
okay so do top down thats like way easy and good
The text was updated successfully, but these errors were encountered:
JohnCorby
changed the title
SearchUtilities.Find feature parity with GameObject.Find
make SearchUtilities.Find work with inactive objects (make it work the same as GameObject.Find)
Jan 6, 2025
Whenever SearchUtilities uses a fallback method because the full path did not work (so it tries a partial path or just the name) make it print out as a debug message the entire path to the object that would have worked instead.
Also instead of just finding by name we should try finding by all partial paths. So say if you are looking for: Sector_DreamWorld/Sector_Underground/Sector_PrisonCell/Ghosts_PrisonCell/GhostNodeMap_PrisonCell_Lower/Prefab_IP_GhostBird_Prisoner
If it is not found then try Sector_Underground/Sector_PrisonCell/Ghosts_PrisonCell/GhostNodeMap_PrisonCell_Lower/Prefab_IP_GhostBird_Prisoner
If it is not found then try Sector_PrisonCell/Ghosts_PrisonCell/GhostNodeMap_PrisonCell_Lower/Prefab_IP_GhostBird_Prisoner
All the way down until we end up searching just by name (Prefab_IP_GhostBird_Prisoner) or until we find it using a partial path.
This will be slow working but it'll be meant just as a fallback and will prompt the mod creator to update the path properly. Slow is better than not working and the mod explodes.
now that owrigidbodys are not unparented until after a frame, most addon paths are wrong (start with body name instead of SolarSystemRoot/whatever_body, and anglerfish are worse) and so search will occur only on the name.
this has already broken some things, such as solar rangers using owlk gameobjects from band together
this can either be fixed by manually checking against those certain paths and making them resolve correctly, or more accurately, by supporting partial paths.
currently gameobject.find does this, but the inactive version does not, and we really should at this point. it wouldnt be that much slower than searching by only name (just get the leaf name and go up the parent or get the root and go down the child.
unity docs suggests it does the formeridk where i got that from)we can benchmark this probably
then we can just be exactly the same as gameobject.find except working with inactive objects too.
implementation
top down
or manually traverse down child but i imagine that is slower
bottom up
also current implementation is top down already, all thats really needed is making it search all objects instead of just root objects
also this means u can remove the step where it search for object by name. can just do gameobject.find first and if that doesnt work do this good way
okay so do top down thats like way easy and good
The text was updated successfully, but these errors were encountered: