I'm having this problem where my sprite is scaled incorrectly. I am using a sprite node, and the problem occurred when I added a script. How do I fix this?
extends KinematicBody2D
var velocity = Vector2.ZERO
export (int) var speed = 1200
export (int) var jump_speed = -1800
export (int) var gravity = 4000
export (float, 0, 1.0) var friction = 0.1
export (float, 0, 1.0) var acceleration = 0.25
var facing_right = true
## Player Movements
func get_input():
velocity.x = 0
if Input.is_action_pressed("ui_right"):
velocity.x += speed
facing_right = true
$Sprite/AnimationPlayer.play("Running")
if Input.is_action_pressed("ui_left"):
velocity.x -= speed
facing_right = false
$Sprite/AnimationPlayer.play("Running")
if facing_right == true:
$Sprite.scale.x = 1
else:
$Sprite.scale.x = -1
func _physics_process(delta):
get_input()
velocity.y += gravity * delta
velocity = move_and_slide(velocity, Vector2.UP)
if Input.is_action_just_pressed("ui_up"):
if is_on_floor():
velocity.y = jump_speed
My Problem