- Home /
Pinball problem
Hello to everyone, I’m making a pinball game. For the simulation of the controllers’ movement (I have two controllers like a normal painball) I have created an animation that rotate the controllers up and down. Here came the problem: when I play and I try to strike the ball.. the ball or the controllers passes through one of two. I don't know if that is a physic problem, or I can't do the movement because of the animation. Thx for the future response.
make sure that they both have colliders on them, and i take it that the pinball itself has a rigidbody attached to it?
Answer by Waz · Jul 14, 2011 at 01:12 PM
Turning on "Animate Physics" on the Animation should fix it.
But why do it that way at all? Wouldn't it be cleaner to just model the bumpers physically and apply a force to them?
Yeah, this sounds like a job for a hinge joint. Set the anchor at the paddle's pivot, leave the Connected Body null, and set the axis and limits correctly. Then turn on "Use spring", and set a high damper force and a very high spring force. To turn the bumper on or off, just change the "Target position" of the spring for the hinge joint.
You may also need to increase maxAngularVelocity - globally or for at least e ball and flippers.
Good point. And also, you'll almost certainly need to set continuous collision detection for the ball and the paddles. (Actually, that may have been the real problem.)
Probably "all of the above" - pinball is an extreme (but perfectly reasonable) test of the Physics system. Fortunately with only 1-3 balls and 2-4 flippers as practically the only moving objects, it's okay to turn on these "work smarter, not faster" options.