- Edited
Please help me, I'm a begginer and I simply can't understand why my character isn't moving.
extends CharacterBody2D
func _physics_process(delta):
if Input.is_action_pressed("ui_right"):
velocity.x = 100
elif Input.is_action_pressed("ui_left"):
velocity.x = -100
move_and_slide()