Forum Archive › Will this keep my VR experience from lagging? › Reply To: Will this keep my VR experience from lagging?
To add on to what was already said, it looks like you have “always animate” on the animator, I’d change that to cull completely or cull update transforms. With always animate you’re animating the characters even when they are not being rendered (not seen in your field of view), which is just adding unnecessary animations being played regardless of whether you are viewing them.
Taken from the Unity docs:
Always animate don’t do culling even when offscreen.
Cull Update Transforms Retarget, IK and write of Transforms are disabled when renderers are not visible.
Cull Completely Animation is completely disabled when renderers are not visible.
The only time I’ve used Always Animate is with a first person controller where the arms went off screen briefly while playing an animation. It kept culling it soon after so I had to change it to always animate so I could see the arms the entire time. In this case you wouldn’t need that.
On a similar note with animations, are these all coming from one set of animations? Meaning is it one character that you animated and applied that to all other characters? Are these the same character models? Also why is there an animator on the terrain?
Since you have quite a few characters I would look at creating LODs (Level of Detail): https://docs.unity3d.com/Manual/LevelOfDetail.html
Basically what this does is it allows you to use lower detailed objects based off the distance from the camera. Up close and you want full detail, further away, less detail which is better for performance. Since it looks like you’d be relatively close to everyone in that crowd, you could focus on having high detailed characters that play the animations and low detailed characters that are “fillers”.
Also agree about the terrain, it might not be a good idea to use a terrain which already looks too big for the scene. Create a much smaller environment, add walls or obstacles to obscure the view in the distance so you can have a smaller environment.
I’m not sure how well occlusion culling works with VR, last time I tried it was with a Gear VR project and occlusion culling seemed to not want to work properly, or maybe that was the preview. Not sure if you’ve ever used occlusion culling with VR @krajca but I’d be interested in knowing if you’ve used something similar to that for VR.