- Home /
Adding a "paddle bump" to paddle in block breaker game?
I have followed a Udemy course to make a block breaker game. I have the paddle script set up so that the paddle follows the mouse, has a collider that collides with the ball, and is limited to moving within boundaries placed.
I am looking to add a "paddle bump" similar to a flipper in a pinball game except the paddle moves straight up and not on a hinge. I would like to have it so that when the player presses spacebar, the paddle will move up and if it makes contact with the ball, it adds a bit more force than if just normally bouncing off the paddle.
I have tried using a hinge joint directly in the middle by searching in pinball guides but that has not worked. My initial guess is that a SliderJoint2D was the way to go, but I do not know how I would have user input cause the joint to activate, have the paddle move upward, and then come back down and stay in that position until the button is pressed again.
I am very new to coding in general, as well as Unity and C#. Any help is appreciated, thank you.