-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Characters animations using AnimationPlayer #7
base: main
Are you sure you want to change the base?
Conversation
…g and turn the character durign movement.
if has_node("AnimationPlayer"): | ||
# Check if animation is null in case it is call dynamically. | ||
if animation_label == null: | ||
$AnimationPlayer.stop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you stopping the animation if you call play_animation()
without parameters? Isn't it better to log a warning to the console and leave the running animation going.
In my head you want to stop an anim by explicitely invoking a stop_animation()
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I think of it, you can't reach this point with a null value, the type is explicit for that argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks for the feedback!
LOOKING.DOWN: animation_label = 'walk_f' | ||
LOOKING.UP: animation_label = 'walk_b' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep the animation suffix consistend with "down" and "up", so walk_d' and
walk_u`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I'm fixing this
Add a few improvements (update the main comment accordingly) thanks to a great pair programming session with @stickgrinder and drbb |
Done:
character turning and animation triggers while moving through the walk cycleTODO:
figure out if it is possible to implement the logic that relies on character looking direction and fallback for all the animations in general