(Rigidbody2D)Breakout Question.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By keito940
:warning: Old Version Published before Godot 3 was released.

With Godot 3.0, since an accident happened while making a breakout, I will just ask you a question.
As you hit the ball, it gradually decelerates and the paddle shifts downward.
I will attach the file of the project, so will you not be able to locate the cause?
Project File:
https://drive.google.com/file/d/1f5bLBxjdPeZUL_gwRwMYy-zRJNzX8o_Z/view?usp=sharing

:bust_in_silhouette: Reply From: kidscancode
  1. The ball is decelerating because of “damping”. The default global damping is set in the Project Settings under Physics → 2d → Default Linear Damp. You can either set this to 0 or set your ball to override this with 0 in the Inspector.

  2. The ball pushes the paddle because they are both RigidBody2D. Rigid bodies behave like physical objects, so when the ball hits the paddle there is a reaction. One workaround would be to change the mass of the paddle so it’s much higher than the ball. Another common option is to use a KinematicBody2D for the paddle and move it manually along the x-axis when detecting input.

  1. Thanks to the solution.
    2)…but the paddle is already KinematicBody2D. I asked on the matter that the paddle would go down on that …

keito940 | 2017-11-27 08:21

Well, perhaps if you shared more details about how you have things set up, it would be easier to try and help you.

kidscancode | 2017-11-27 16:49

In that case, please look at the attached project file.

keito940 | 2017-11-29 08:40