hey, i’ve been making a game and everytime i add a few trees the fps drops by quite alot, is there a way to make it so it doesn’t lag as much? like if I make the entire terrain with the trees on it on some modeling program like cinema4D and import it to unity, will that make it lag less cause its just 1 thing and not alot of assets? thanks!
Trees is big problem of optimisation. Every mesh tree rendered as a batch and they have a lot of polygons. Try to lower billboad distance
Nice tutorial with example scene is here:
http://doctrina-kharkov.blogspot.com/2017/12/optimizatsiya-unity-3D.html
A lot of times the “lag” you speak of is a drop in FPS due to rendering overhead. The most likely, especially if you are on mobile, is high draw calls. The fact you say adding trees is making it worse, I would bet it is a draw call issue, so you should look into batching them. Here is some Unity documentation going over that:
Outside of that, your questions is very vague, as there is no "one size fits all optimization answer. Optimizations can vary drastically from one platform to another, as well as vary depending on what part of the game you are optimizing (FPS, memory, etc). You should profile your game and find out exactly what is causing your issues, and focus on optimizations there first. Here is a video tutorial on using the profiler and much more about it can be found on the Unity docs:
There are a lot of really good articles out there on optimizing Unity games (not to mention the Unity docs themselves), but here are a couple I have found helpful.
http://wiki.unity3d.com/index.php?title=General_Performance_Tips