- Home /
Make new objects static by default
Is there a setting in Unity that will make new GameObjects be set to Static by default? I use static objects in this project much more often than non-static, and I don't want to forget to mark all of them. I would rather mark the objects that are not static.
Answer by Casiell · Jul 10, 2019 at 06:33 AM
Not really, no. If your hierarchy allows that, there is an option to mass change objects to static. If you check (or uncheck) the box on parent gameobject, unity will ask if you want to apply this to all its children.
Of course you can also write a simple editor script. It's possible to add entries to "Create" menu. You could write one to create a game object and set it to static right after
Answer by bpaynom · Jul 10, 2019 at 08:13 AM
You can make a script that usesOnHierarchyChange(). Stores all the GameObjects in an array and compare with the list of GameObjects in the scene at the time it's called. Set as static every GameObject that is new in the stored list, then update the list.
Answer by JunaidGhani · Jul 10, 2019 at 07:11 AM
press ctrl+a in hierarchy , mark all as static! there you go.
and then unmark objects that are not static.. Hope this helps