I released my Unity-based pinball game for both the iPhone and Android platforms some time ago, and in that release were a few bugs that players had to put up with. Before the release, the ball would frequently go through flippers and other things in the playfield. The best I could do to resolve the issue was ultimately to reduce the maximum velocity of the ball. The reason for that is increasing the number of physics steps, collision sensitivity, and other settings really hurt mobile performance. In the end, I made the release with the collision problem minimized but not absent, and players were generally happy despite the slow ball velocity.
After doing final testing for the PC version, and seeing both problems really ruin the game; I've finally reached the end of my rope. I'm within two weeks of the release (I hope), and needed to fix both problems NOW. Fortunately, this morning I found this post:
Some of the things suggested were things I had already done before, but here's what else I changed today:
- Change Min Penetration for Penalty from 0.01 to 0.001
- Increase Solver Iteration Count from 7 to 15
- Reduced the mass of the ball from 0.1 to 0.004 to improve speed
- Increased the flipper spring strength from 65,000 to 100,000 to improve speed
Consequently, I got the ball going fast again, and despite applying some big velocities, it never penetrated a static collider! Meanwhile, the performance of the game itself remained fast. Unfortunately, the ball would still sometimes go through the "ball guard," which is a bolt of lightning connecting the flippers designed to keep the ball from going down the drain. It's actually a rigidbody connected to each flipper with joints; the ball isn't supposed to pass through the body of course.
I hope I can find a fix for the ball guard; I'll make it a static object if I have to. It just won't look as cool...but a ball going through it looks even worse!