Ball gets stuck instead of bouncing using bounce() and move_and_collide()

Does the paddle use move_and_collide? It sounds like the paddle is moving into the ball which will cause a deeper collision than .bounce alone can handle, it will bounce away, but still be a pixel within the wall so another collision happens thus another bounce.

Maybe you can check the dot product of the collision normal and the ball’s current velocity.

func _physics_process(delta):
	var colisionInfo := move_and_collide(velocity * delta)
	if colisionInfo:
		var normal := colisionInfo.get_normal()
		if normal.dot(velocity.normalized()) <= 0.0:
			velocity = velocity.bounce(normal)
			var checkBrick = colisionInfo.get_collider()
1 Like