It's hard to tell you much without being able to see the rest of your project. You might make sure that you haven't moved any of the children of your objects away from their parent.
Edit: I don't know if this helps any, but here's some code I made to test bouncing a ball around.
# game.gd
extends ColorRect
var vel := Vector2.ZERO
var ball:KinematicBody2D
var wall:StaticBody2D
var bound:Area2D
var timer:Timer
func _ready() -> void:
randomize()
wall = StaticBody2D.new()
wall.name = 'Wall'
var sh = RectangleShape2D.new()
sh.extents = Vector2(500, 50)
var par = [ Vector2(300, -50), Vector2(300, 650) ]
for c in par:
var cs = CollisionShape2D.new()
cs.shape = sh
cs.position = c
wall.add_child(cs)
add_child(wall)
sh = RectangleShape2D.new()
sh.extents = Vector2(50, 300)
par = [ Vector2(-50, 300), Vector2(850, 300) ]
bound = Area2D.new()
for c in par:
var cs = CollisionShape2D.new()
cs.shape = sh
cs.position = c
bound.add_child(cs)
bound.connect('body_entered', self, 'out_of_bounds')
add_child(bound)
ball = KinematicBody2D.new()
ball.position = Vector2(400, 300)
ball.name = 'Ball'
var cs = CollisionShape2D.new()
sh = RectangleShape2D.new()
sh.extents = Vector2.ONE * 10
cs.shape = sh
ball.add_child(cs)
var cr = ColorRect.new()
cr.rect_size = Vector2.ONE * 20
cr.rect_position = Vector2.ONE * -10
ball.add_child(cr)
add_child(ball)
timer = Timer.new()
timer.wait_time = 1
timer.one_shot = true
add_child(timer)
timer.connect('timeout', self, 'on_timeout')
vel = Vector2(-10, 0)
func _physics_process(_delta: float) -> void:
var coll = ball.move_and_collide(vel)
if coll:
print('collision with %s' % [coll.collider.name])
vel = vel.bounce(coll.normal.rotated((randf() - 0.5) / 5.0))
func out_of_bounds(body):
print('%s went out of bounds' % [body.name])
timer.start()
func on_timeout():
if vel:
vel = Vector2.ZERO
ball.position = Vector2(400, 300)
timer.start()
else:
vel = Vector2(10, 0).rotated(2 * PI * randf())