Why am I getting terrible performance on devices with > 120 game objects?

This is only my third day learning Unity, so please bear with me if this is a really silly question, but why am I getting such terrible performance on my very simple game? Here’s a screenshot:

My game is a simple coin pusher game, the “push bar,” aka the raised bit in the center channel, will periodically move back and forth, and if a coin is pushed off the edge, then it is destroyed, and the player’s score and available coins goes up. I’m not doing anything fancy, as you can see, there are about 100 “coins” currently on the screen, but even this number starts to bog down the game on android devices. At ~120 coins, the game is completely unplayable. I don’t quite understand why my performance is so bad.

Each coin is a cylinder with a mesh collider. Using the standard capsule collider is not an option because of how thin each coin is. If the height is less than the radius, the collision box just becomes a sphere, which makes them stack very strangely. As such, each coin is ~80 verts and tris. I do have shadows turned off for all dynamic objects, and the update for everything but the touchManager is empty. The touchManager checks for a touch or a mouse click, and if and only if there is one, continue with more logic. Even when not touching the screen, the game is very slow, so I don’t think that that is the problem. In fact, the slowdown only really happens with the pushbar approaches the coins, which made me think there was something wrong with the coins.

However, the coins don’t even have a script associated with them, so it can’t be performance from the script causing this bog down. I handle collisions in the “floor” object (doesn’t have a mesh renderer, so you can’t see it, but it’s about 10 units below the visible screen), so that shouldn’t be causing issues unless there are coins near it.

The only thing I can think of is that this number of rigidbodies is somehow causing terrible performance, but 120 doesn’t even seem like that many… Can anyone help me out?

120 rigidbodies with mesh colliders (the most expensive collision type) is a lot, especially on a mobile device. 120 objects x 80 verts, checking for collisions against 119 other objects x 80 verts, every frame, is a lot of calculations…

Assuming you don’t have Unity Pro (and therefore can’t use the profiler) we can only speculate, but your main thread is taking up a lot of time which is consistent with your slowdown being caused by physics calculations.

You might want to rethink your design - given that your objects are very specific, consistent shape, you could write your own physics/collision handling functions tailored to dealing with collisions between thin cylindrical objects.

The only other thing I can suggest you look at is the VSync count in your Editor Quality settings - is it set to Don’t Sync?