0 votes

I have two RigidBody2D, one ball (character mode) and one block (static mode) and when the ball collides with the block, I want to apply a force in the opposite direction, causing it to bounce. If there is another simpler way to do this, please tell me.

in Engine by (652 points)

Why use a RigidBody when you could use a KinematicBody for the ball, and a StaticBody for the blocks?

1 Answer

0 votes

I think what you need, if i did not missundertood, is to set the bounce property to non-zero value (this property can be set from inpector). if you want the ball to bounce in a perfectly "elastic" way, and never stop bouncing, put bounce in 1. If you want the bounce to be more "plastic" and the sucesive bounces to be decreased in magnitude, so put bounce to a lower value, like 0.3.
Does this help?

by (3,382 points)
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.