I'm beginning with Godot making a simple Sprite which should move both left and right but when right key is pressed the
KinematicBody2D doesn't move right. According to the logic it should does but it does not.
I leave the code below hoping someone could help me to find the error
extends KinematicBody2D const VEL = 50 var vec_mov = Vector2() func _ready(): pass # Replace with function body. func _physics_process(delta): if(Input.is_action_pressed("ui_right")): vec_mov.x += VEL if(Input.is_action_pressed("ui_left")): vec_mov.x -= VEL else: vec_mov.x = 0 move_and_slide(vec_mov)