Is there some way to isolate or offload a particular physics processing for a particular set of game objects? I’m not talking about just putting collision layer masks on interaction methods, but prevent anything from processing on a set of collider objects that are not X type game object or Y type physics interaction.
Some context: We are currently utilizing a headless unity instance (2020.3.17f1) for our authoritative game server, and as we have progressed further in development of our larger scenes, just having the static ground colliders active in the scene, without desired interactions being run on them, is causing huge performance problems.
We minimized mesh colliders faces and tried to do primitive approximations as best we could without sacrificing too much accuracy. Almost all of these colliders though are only used for a single purpose → to check if/when a player is grounded. Nothing else needs to interact with these colliders except the box raycasts being projected down from our players. See one of the spikes below with only the terrain collider active, and 0 players on server:
No players, 0 ray/box casts, but still huge performance issues. Not sure if the main culprit is these overlaps and contact counts as turning off the terrain does nothing to these values, but maybe its just counting and not processing? Ideally these ground colliders would NEVER interact or process with anything that is not a box raycast from a player, but I’m not sure if its possible to configure the physics system in a way to isolate to only those interactions when dealing with these specific static colliders.
Might be reaching for a magic pill solution here, maybe its just simply a matter of making more primitive collider approximations and just removing all our mesh collider scene geometry from our server box, or if there is some practice and configuration we are missing to make this a non-issue. Still tinkering with changing broadphase types and adjusting physics system parameters, but I don’t really fully understand the extent of adjusting these settings beyond what the documentation outlines.
I’m definitely not an expert on Unity physics. Any resources, assets, advice, or points in the right direction would be greatly appreciated.
So far I’ve reviewed and tried different optimizations from these sources with no luck:
https://docs.unity3d.com/Manual/iphone-Optimizing-Physics.html```
... and more blog posts than I care to admit that just have regurgitation of similar solutions
**Findings:
> Looks like the actual culprit was not the mesh collider volumes or static terrain volumes, but was actually these kinematic rigidbodies that were left over from a test phase on area of influence sphere colliders. Didn't realize as the the rigidbody count was showing 0 on the profiler, must be labled under kinematics?
> Utilizing the Layer Collision Matrix to ignore layers of collision not needed also had large performance gains.
