- Home /
What game objects to declare static?
I have seen some answers, but i don't understand.Following some tutorial(it seems i don't understand the idea) i marked every game object in Hierarchy as static so the enemies of the player (with nav mesh agent) would correctly use the terrain,the buildings,the trees and not to pass through them.After baking in the navigation my unity 5 just crashes (easily getting to 100% CPU usage).I should declare the terrain static?What game objects should be static?And the fact that unity freezes while processing hundreds of jobs(clustering, light transport and others) is related to this or is because i have objects made of many components?Generally speaking, what should i do so that unity(both in editor and playmode) could run more smoothly?I know these are a lot of topics and questions, so please be patient.I'm working for only 2 weeks with unity(nothing similar previously).Thanks
Answer by Landern · Jun 08, 2015 at 02:13 PM
This is covered pretty well in the Manual under Static GameObjects. Some of the basics are, if you're going to have a GameObject that is stationary in the scene, then why have the Unity Game Engine worry about all the behaviors a moving objects needs to make it dynamic and super nifty. Likewise(and this will affect build speeds), the global lighting can be baked into textures rather then kill performance by dynamically updating the view port for the game. Static batching of GameObjects combines meshes into one big one reducing draw calls when the same material is used.
I'll save the rest for you, the Static GameObjects Documentation has the links to considerations that speak specifically to the static check box in the inspector and how it's useful and under what conditions.
Thank you very much Landern for your insight and links.Now that i have changed realtime GI with baked lighting my unity works a lot better.Thanks again!
Your answer
Follow this Question
Related Questions
Need help with a shader that uses additive particle blending (worked in 4.6; broken in unity 5): 0 Answers
Unity graphic looks more Ugly than Unreal engine ? 2 Answers
How can I get shadow matrices in LightEvent.AfterShadowmap event of directional lights 1 Answer
Graphic issues on android tablet in Unity 5.2.1 0 Answers
unity 2d: scaling sprites problem. 1 Answer