I have been following GDquest's "Your first game" tutorial, I made the function get_direction, however, it is not returning the Y component of Vector2. Here is the code:
```extends Actor
var strength_track = 0.0
func physicsprocess(delta: float) -> void:
var movedir = getdirection()
print(movedir.x)
if movedir.x == 0.0:
$AnimatedSprite.play("Idle")
elif movedir.x < 0.0:
$AnimatedSprite.fliph = true
$AnimatedSprite.play("Walk")
elif movedir.x > 0.0:
$AnimatedSprite.fliph = false
$AnimatedSprite.play("Walk")
velocity = speed * movedir
velocity = moveand_slide(velocity)
func getdirection() -> Vector2:
return Vector2(
Input.getactionstrength("Right") - Input.getactionstrength("Left"),
-1.0 if Input.isactionjustpressed("Jump") and isonfloor() else 1.0
)```