Hi, I have had a problem with FPS in my game for several months. Most likely it is the fault of the trees / bushes.
I tried to change the collision, but this is not an option, because the trees become cubes and the arrows get stuck in them. I also changed RenderFidelity to automatic, but it didn’t help either, because the player can be seen from a distance.
All trees / bushes are MeshParts. What could I do to improve performance?
I looked at other scripts and they don’t look infected.
It could be because your map is rather quite large with high amounts of detail. That’s what I’m inferring right now. You might be able to fix this by only have some parts of the map loaded in or separate them into sections? Like the way round based games have only one map down at a time.
That’s because the trees have a big amount of triangles (With my experience)
If the player have a limit of where he can walk, you can remove some trees and convert them into images, some famous games used that to optimize thousand of trees/monsters/etc.
I see you’re using fog, you can try to use StreamingEnabled to attempt to get a fix on this. Although you need to be careful with this feature because it can cause some unwanted side effects. Another great tip is to check how many polys your tree models have and reduce the models quality, with in use in textures you can easily compromise between detail and performance that way.
As mentioned by @Conejin_Alt, you should check how many triangles those trees have and possibly turn some into decals if there’s a limit to where you can walk and it isn’t very noticeable. If that isn’t the case, then I wouldn’t know.