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.
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:
Also, a few other things:
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)