What is not working? collisions or movement?
So, you mapped "left" and "right" actions to some keys? cause i tried on my machine and it works fine. I used this and moved with the arrows:
extends KinematicBody2D
var velocity = Vector2(250,0)
const SPEED = 550
func _ready():
pass
func getinput():
if Input.is_action_pressed("ui_right"):
velocity.x = SPEED
elif Input.is_action_pressed("ui_left"):
velocity.x = -SPEED
else:
velocity.x = 0
func _physics_process(delta):
getinput()
move_and_collide(velocity * delta)
If you want to change the velocity with the touchscreen buttons, then you should try checking if they are pressed with something like:
if get_node("TouchScreenButtonRight").is_pressed():
velocity.x = SPEED
elif get_node("TouchScreenButtonLeft").is_pressed():
velocity.x = -SPEED
else:
velocity.x = 0
Obviously, replacing for your nodes names in the get_node
function.
About the collisions, for KinematicBody2D to collide, those collision shapes have to be children of other bodies, like StaticBody2D, or RigidBody2D. Bodies collide with bodies, they dont collide with just shapes. Areas dont collide, but detect when a body or other area enter or exit the area.