slow when many objects

I have a game that runs fine on my iphone 5s but really slow on my HTC 8X windows phone.
The scene has about 800 boxes that each has rigidbody and 2d box collider.
When I don’t create any boxes, the game runs fine on WP. when i have all 800 boxes, game runs really slowly.
I know that as i increase # of colliders, the # of collision check that Unity has to do increase exponentially.
My questions are:

  1. is there a good way to do more lose collision detection? In other words, without changing my game too much, is there a setting in Unity that could handle large # of object more efficiently?

  2. My game is ‘scorched earth’ style game but with square boxes instead of dirt. So imagine tanks sitting on top of 10*80 boxes. So all colliders are pretty much touching each other. I was thinking about starting with larger boxes, and as missiles hit boxes, those boxes are broken into pieces. Is there some example code that does this?

thanks

If you're trying to use 2D rigidbody boxes like voxels, then you're doing it wrong. Look up how voxels work.

1 Answer

1

without changing my game too much, is there a setting in Unity that could handle large # of object more efficiently?” - IMHO, no. You can tweak physics settings, adjust discrete collision detection, time step etc. , but at the end of the day 800 rigidbody/collider interactions is just way, way too many for a mobile CPU to handle. You need a fundamentally different approach.