2D Pinball machine - Extreme ball velocity with kinematic paddles

Thomas KoleThomas Kole Posts: 3Member
edited March 14 in 2D

As an exercise, I'm trying to make a 2d Pinball machine.
The ball is a simple Rigidbody2D with a circle collider, the paddles are KinematicBody2D's with rectangular colliders.
I set the rotation of these guys in _PhysicsProcess.

As you can see in the gif, sometimes it goes ok, sometimes the ball reaches super high velocities (as you can see in the log screenshot). What would be the best way to implement these paddles?

Thanks for helping out!
Thomas


Tags :

Best Answer

  • Thomas KoleThomas Kole Posts: 3
    Accepted Answer

    I think I've figured it out. I have the right paddle mirrored, the left paddle does not seem to misbehave.
    I've changed my logic so it's not mirrored anymore, and voila :)

Answers

  • MegalomaniakMegalomaniak Posts: 2,661Admin

    Not sure whats up with the paddles, but maybe you can implement some limit to how fast they can rotate.

    Also, might be that you have no friction nor air resistance implemented? In real pinball machines there's no vacuum nor magnetic suspension/levitation of the pin-ball, right? That might also help limit the speed the pin-ball can travel.

  • Thomas KoleThomas Kole Posts: 3Member
    Accepted Answer

    I think I've figured it out. I have the right paddle mirrored, the left paddle does not seem to misbehave.
    I've changed my logic so it's not mirrored anymore, and voila :)

  • Thomas KoleThomas Kole Posts: 3Member

    I consider this test done, this is a lot of fun!

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file