How do I stop my game from lagging

Hi,

what I wont in my game,

high poly characters, a lot of objects in my scenes, a lot of high poly enemys, good looking animations and textures, well that sounds like a laggy game to me so I thought of one good why to fix the lag that other games also use but I dont now what it is called so i well try to explane what it is

they use it in runescape and world of warcraft and i think black ops 2 nazi zombies so5547-runescape.jpg

do you see the fog in the back ground well you cant see past the fog so you can only see in that small area so the game is only using the area that you can see to im pritty sure and as you walk it generats i think its a online game so i dont now exactly how it works

sorry i was not vary discriptive but i dont now how it works and i dont now the name of it so if anyone gets what im saying please tell me if this is called something or if there a video or righting on how this is done

If you use Pro use the LOD system. If not, buy an LOD system from the Asset store. Those let you turn things on/off by how far they are from the camera.

Just because I saw the only Reply here was Terrible Advice, and don’t want other Unity Beginners to fall for Scam Advice, I will give you the PROPER answer the Question was actually looking for;

First Open up your Camera, And where it says “Clipping Planes Near” You can change the “Far” Value from it’s Original, Too something like 300 or lower. This will give you the Second Effect you explained in your Question, And the First part of your question is quite literally just as you said It, “fog”. You can look up “Unity Fog” for more information about it, But i believe it’s somewhere in Window>Rendering>Lighting and Look for “Other Settings”, There should be Fog Settings there! These are quite literally the Two ways you can achieve the Effect you’re looking for. If you’re looking for even more optimization Tips, I would look into “Occlusion” which Comes with Unity, So no you don’t have to buy it “Cough Cough, DaveA”, Look into Distance LOD, Which ALSO comes with Unity. You feed it a few different versions of your Models, Textures, Rigs, Etc, And When you are a Current Distance away from it, it will activate one of the Lower Resolution Models in replacement of your High poly one. Occlusion I believe just completely gets rid of Vertices and Triangles that are not on Screen. Another Tip is Reducing Texture Sizes, You really don’t need 4k and 2k textures like you think you do… Trust me, I made this mistake lol & 1080p works just fine! Also Combining Large Textures so instead of Using 4 Different Materials, It only takes 1. And Baking your Lighting instead of Using “Realtime” or Mixed Lighting, Will save on Performance quite a bit. Lastly, Optimize your code! I script visually personally so i can’t tell you much about this, But if you work in C# i would consider looking into Unity’s Jobs System. All of these Tips and more Google Searching about these Topics, Should set you or Any Beginner in the right direction for Optimization! But in most cases, you probably won’t need it if your Model Poly Count is less then 10-5k, Or if you are new to Unity and don’t plan on making a Large open-world game for your first Project…

And for Those who ARE looking to spend money on the Asset store for Optimization, I recommend 3 Plugins, But really you probably won’t need them if you took my advice above.

  1. EasyOptimizationTools (This one is the Cheapest on the Store, Least Reviews if any, But I personally use it and it Works Very well for optimizing little areas, Like Combing Meshes Easily, Or Hiding Objects dependent on their Distance, Sorta like Clipping Planes Near but more effective)

  2. Bakery - GPU lightmapper (haven’t personally used this one yet, but ive heard tons of great things about it performance-wise, and the speed it takes to bake lighting compared to regular Unity Light Baking!)

  3. GPU Instancer. (This one is probably the most expensive on the List I can assume, I purchased it on Sale Tbh. But it’s done a lot for Performance in my games, And if you take the time and take the Steps I left at the start about optimizing without Spending any money, Once you do those steps then GPU Instancer becomes 10x easier to work with and to Optimize your game to perfection!)

Regardless what you chose, Just know there are things you can do for FREE and yourself quite easily, that can save performance and really aren’t to difficult to learn, as much as they may sound like it lol. Also be sure to Build your Game and Run it to make sure the Lag/Issue is actually occurring not just in the Unity Editor, but in the Build of the game too.

(Extra Tip: try not to Render Multiple Cameras Like Security Cameras, Etc, This was cause the Camera to Render Everything in the scene a Second time. You can achieve that effect by making a New Layer specifically for the second Camera and only Render that Layer)

Goodluck!