Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created October 11, 2021 04:33
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
# Gist does not work syntax highlights for ".gd" extention files. ".cs" is dummy extention.
func _physics_process(delta):
if vel.x > 0:
$AnimatedSprite.animation = "walk"
elif vel.x < 0:
$AnimatedSprite.animation = "walk_back"
if vel.length() > 0:
$AnimatedSprite.play()
else:
$AnimatedSprite.stop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment