Итак, я полный новичок ie в кодировании, и поэтому я следовал этому уроку: https://www.youtube.com/watch?v=BeSJgUTLmk0
И я не могу ни двигать KinematicBody2D, ни вниз
Вот код
extends KinematicBody2D
var MaxSpeed = 500
var Accel = 5000
var Motion = Vector2.ZERO
func _physics_process(delta):
var Axis = GetInputAxis()
if Axis == Vector2.ZERO:
ApplyFriction(Accel * delta)
else:
ApplyMovement(Axis * Accel * delta)
Motion = move_and_slide(Motion)
func GetInputAxis():
var Axis = Vector2.ZERO
Axis.x = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")
Axis.y - Input.get_action_strength("ui_up") - Input.get_action_strength("ui_down")
return Axis.normalized()
func ApplyFriction(amount):
if Motion.length() > amount:
Motion -= Motion.normalized() * amount
else:
Motion = Vector2.ZERO
func ApplyMovement(acceleration):
Motion += acceleration
Motion = Motion.clamped(MaxSpeed)
и да, мои клавиши установлены правильно