Created
October 11, 2021 04:33
-
-
Save flushpot1125/e8b75475b5eb001275abacd25775bdc8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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