Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extends KinematicBody2D
- onready var animatedSprite = $AnimatedSprite
- func _physics_process(delta):
- var axisX = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")
- if axisX > 0:
- animatedSprite.animation = "run"
- animatedSprite.flip_h = false
- elif axisX < 0:
- animatedSprite.animation = "run"
- animatedSprite.flip_h = true
- else:
- animatedSprite.animation = "idle"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement