I’ve got a bunch of scene content I’m loading at runtime with SceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Additive). This is all scenery, so most of it is marked Static (Everything) in the inspector.
At runtime, I want to know whether an object is static or not, so I check gameObject.isStatic. When testing in the editor, this reports true on the objects I would expect. But at runtime (testing on Oculus Quest, if that matters), it returns false on objects that I know should be static.
What’s going on? Is it impossible for statically-loaded objects to actually be static? Does isStatic simply not work in builds? Is it a Unity bug?
Those are reasonable ideas. But my issue isn’t so much detecting whether objects are in a particular category — I realized another, more direct way to tell that.
My bigger concern at this point is whether these objects are or are not static, performance-wise. As our scene grows, it’s going to be very important that these objects batch for rendering, have efficient mesh collider tests, etc. So the fact that they’re reporting nonstatic worries me.