Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Suikurx |
func _physics_process(delta):
motion.y += GRAVITY
if motion.y > MAXFALLSPEED:
motion.y = MAXFALLSPEED
if facing_right == true:
$Sprite.scale.x = 1
else:
$Sprite.scale.x = -1
motion.x = clamp(motion.x, -MAXSPEED, MAXSPEED)
if Input.is_action_pressed("ui_right"):
motion.x += ACCEL
facing_right = true
$Sprite/AnimationPlayer.play("Running")
elif Input.is_action_pressed("ui_left"):
motion.x -= ACCEL
facing_right = false
$Sprite/AnimationPlayer.play("Running")
else:
When I type “if facing_right == true:” the error shows up. Is there a way I can fix this?