How to make rigid body bouncey

Godot Version

4.2.1

Question

I’m trying to make a bouncey ball using a rigid body, but one problem: how do I do that? I’ve been trying to make it, but whenever it hits the ground, it doesn’t bounce at all. Another thing is I set the collision layer of the ball to 2 so that way the player could move it around, but I want it to stop the player from moving when the player tries to move it into a wall instead of moving into it and causing visual errors.

In the inspector, with the RigidBody2D selected, you will want to add a Physics Material in the drop down menu for Physics Material. Then, when you click on the physics material you created, you will have a new menu open up, with a slider available for bounce. Setting it to 1 will make it bouncy.

Sorry if this is at all unclear. Not in front of the PC right now. I hope this helps!

rigid-body

1 Like

Cool thanks for the help. Just need to figure out how to make the player collide with it when the player pushes it into a wall or floor or ceiling

Yeah sorry, I would help you more with the physics-based problem, but I’m new to Godot and creating my own physics problems as we speak!

Actually, let me know if this video helps: https://www.youtube.com/watch?v=SJuScDavstM

I finished watching it, and after working with it for a bit, there are some errors. Whenever the player collides with the ball, they come to a complete stop. It might be because I’m using a collision polygon instead of just a shape for the player. Also, jumping on top of the ball is very broken because it’s bouncy.

Bump

If you want player to interact with rigid bodies its better to make player rigid body too.
Otherwise you’ll need a lot of hacks to make it work.

Put this into your Player movement script :

if collision.get_collider() is RigidBody2D:

		collision.get_collider().apply_central_impulse(
			-collision.get_normal() * 25
		)