I am having the same problem.
I'm prototyping a basic ball / brick / paddle game to learn Godot.
I am using KinematicBody2D as per the description in the documentation:
They are not affected by physics at all (to other types of bodies, such a character or a rigid body, these are the same as a static body).
My ball is a simple RigidBody2D with child a child CollisionShape2D and the following basic code for the ball to draw a circle and apply impulse upon game start:
var released = 0
onready var timer = get_node("label_start/timer_start")
draw_circle(Vector2(0, 0), 15, Color(255, 0, 0))
if event.is_action_pressed("ui_accept") && timer.time_left == 0 && released == 0:
released += 1
apply_impulse(Vector2(0, 0), Vector2(0, 200))
The paddle is a KinematicBody2D with child CollisionShape2D and Polygon2D. The code in the paddle simply moves it using moveandcollide based upon key inputs:
export (int) var speed
var velocity = 0
var input_direction = 0
var direction = 0
onready var screensize = get_viewport_rect().size
var move_left = event.is_action_pressed("ui_left")
var move_right = event.is_action_pressed("ui_right")
var stop_moving = not (Input.is_action_pressed("ui_right") or Input.is_action_pressed("ui_left"))
input_direction = -1
input_direction = 1
input_direction = 0
if move_left or move_right or stop_moving:
direction = input_direction
velocity = speed * delta * direction
position.x = clamp(position.x, 0, screensize.x)
Now, as I read it, this should work fine. But when the ball hits the paddle, the paddle is moved as if it were responding to physics, despite the description stating that it shouldn't.
I'm a novice programmer, looking to move away from Game Maker. So I would appreciate any help, as I'm sure it's me rather than a bug with Godot. But it does seem to me that the KinematicBody2D is not working as intended, so I'm not sure where to begin.