in my game there are many boxcolliders. But i need only a few of them in a camera view (only the colliders which are seen with the camera). Is there a way to disable the colliders which are not seen with the camera? Or are there other possibilities?
The name isn’t especially suggestive, but the GeometryUtility class might help you out here. The CalculateFrustumPlanes function creates a list of plane objects marking out a camera’s view frustum. The TestPlanesAABB function then uses this list to test whether a bounding box is in the frustum or not. You can use these together to test whether a camera’s view contains an object regardless of whether it is rendered or not.