The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

+1 vote

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 (695 points)

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

1 Answer

+1 vote

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,505 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 Frequently asked questions and 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 [email protected] with your username.