i have set up a movement script for left and right on a platformer but i can't move (i have bound the keys)
here is the script
extends KinematicBody2D
var score : int = 0
var speed : int = 200
var jumpforce : int = 600
var gravity : int = 800
var vel : Vector2 = Vector2()
onready var sprite : Sprite = get_node("player sprite")
func _physics_process(delta):
vel.x = 0
if Input.is_action_pressed("ui_left"):
vel.x -= speed
print_debug("left works")
if Input.is_action_pressed("ui_right"):
vel.x += speed
print_debug("right works")
vel = move_and_slide(vel, Vector2.UP)
by the way one I'm following a tutorial on youtube
and I'm new to godot :/
i switched to the preset buttons but it is still dis-functional
(the if statements are not getting called)