Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Ziemniaczek2012 |
here is my code can u repair it?
extends KinematicBody2D
var speed = 100
var motion - Vector2(0, 0)
func _ready():
set_physics_process(true)
func _physics_process(_delta):
if Input.is_action_pressed(“ui_left”):
motion.x -= speed * delta
elif Input.is_action_pressed(“ui_rigth”):
motion.x += speed * delta
elif Input.is_action_pressed(“ui_down”):
motion.y -= speed * delta
elif Input.is_action_pressed(“ui_up”):
motion.y += speed * delta
else:
motion.y = 0
motion.x = 0
move_and_slide(motion)