- Home /
Unity 5.3/5.4b: HideFlags and scripts not running?
My team is using HideFlags with an internal source control system to allow us to lock root objects in scenes from being edited. This system has worked for us through 4.0 through now, but starting with 5.3, hidden objects in Hierarchy don't have their scripts run when Play is pressed.
Essentially, using HideFlags.HideAndDontSave before would still render the objects in the game and run their scripts on play. Starting with 5.3, when play is pressed, the objects disappear from hierarchy and their scripts are not run. This is obviously a problem since some of our major gameplay systems are on a root GameObject "Layer_Gameplay", and when I'm trying to edit "Layer_Geometry" root gameobject, it depends on my singletons being properly initialized and run.
I've tried also using HideFlags.DontSaveInEditor, HideFlags.NotEditable and HideFlags.DontUnloadUnusedAsset, but now I have the situation where the little lock shows up in Hierarchy for these objects, but when I hit play they simply disappear (marked HideInHierarchy) even AFTER play is depressed.
Thanks!