0 votes

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:

in Engine by (48 points)
edited by

1 Answer

+2 votes
Best answer

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.

by (20,895 points)
selected by

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 ...

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

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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.