Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | TomisOps |
extends KinematicBody2D
var velocity = Vector2()
func _physics_process(delta):
if Input.is_action_pressed("ui_right"):
velocity.x = 30
elif Input.is_action_just_pressed("ui_left"):
velocity.x = -30
else:
velocity.x = 0
move_and_slide(velocity)
moving to the right works perfectly but to the left it moves like 30 pixels to the direction inmediatly and then stops.
I been following a tutorial and everything is the same.