HideFlags.DontSave and FindObjectOfType

I have a weird behaviour that I don’t understand.

If I dynamically create a gameobject with HideFlags.DontSave I can’t find it with GameObject.FindObjectOfType.

If I remove HideFlags.DontSave, it work. Anyone have an idea why?

can’t find something that isn’t in the scene…

When I read that, the way I understand, it mean the object won’t be save in the level.scene but it can exist at runtime. But maybe that means in the scene at runtime too.

1 Like