Pinball game has a physics problem

I am creating a pinball game and using the physics engine, but somehow things are not working as expected.
Take a look at the video and see what I mean.

Any help will be great.

Perhaps your paddles move to fast for the ball to actually react to them. There may be settings for increasing the number of physics calculations per frame or similar you can use within Unity?

Also, I would not use Unity’s physics for a Pinball game. You’re guaranteed to encounter bigger problems than that when using physics. A pinball game has very simple dynamics and everything needs to be very precise. I don’t think you can get that from the physics system.

You’re better off coding your own pinball physics.

While I have written pinballs in the past using my own physics, todays physics engines are capable of doing pinball - future pinball is a good example. Having said that - it’s not easy. With rigid joints not being rigid you end up adding more springs than you’d like, invisible colliders where the ball doesn’t do what you want and more like that. One thing you definitely want to enable is continuous collision detection. But, I also agree with Twiik, pinball physics are the easiest to write, you might want to consider doing it yourself and save a lot of pain from exploding physics. \But just wanted to state that it can be done with a physics engine.

Thanks TwiiK and sourcerer for the replies.
I was hoping that the physics engine would take the hard work away, but it looks like I have to do more work.

Ok, time to do more head bang.
More solutions are always welcomed.

Here’s a couple things that helped me:

  • Reduced Fixed Timestep to 0.015 (I may regret this when I move the project to the iPhone)
  • Each flipper is about 40 units end-to-end and has a configurable joint. Under Angular XDrive, I have Position Spring and Maximum Force set to 60,000. Each flipper also has a child object consisting of a simple box collider that just encompasses the flipper size.
  • Applied a velocity cap of 300 to the ball
  • Applied the http://unifycommunity.com/wiki/index.php?title=DontGoThroughThings script to the ball and set it up so it only raycasts the flipper.
  • Made it so gravity is not applied to the ball when it comes close to the Y position of the flippers.
  • Added a trigger below each flipper. These triggers are as wide as the flipper and go 20 units below it. When touched, the ball velocity is reversed and the flippers become triggers until the ball is above them (this allows the ball to glide through them).

Also, a few other things:

  • I made the colliders that surround the playfield significantly larger than the box meshes
  • Beyond the colliders, I have the whole playfield surrounded with ball catches – these are triggers that immediately transfer the ball back to a starting point.

It seems like a lot of work…I’d like to find a more correct solution, but this gets me by (at least until i see the ball escape again)