Skip to content

Is it possible to use block coding for implementing the animations of a 2d characterbody? #399

Discussion options

You must be logged in to vote

Hello @RealGabrielDelRosario, is good to know that you find block coding intuitive! This is how I would do it:

  • Add a SimpleCharacter node (which inherits CharacterBody2D node) for the movement.
  • Add an AnimationPlayer node for the animations.
  • Setup your animations. Example: an idle animation and a walk animation.
  • Add blocks to both nodes so that when the character moves (check SimpleCharacter node Velocity property) the walk animation is played. And when it doesn't move, the idle animation is played.

Keep in mind that the CharacterBody2D node in Godot is only for physics, has nothing to do with the visual aspect of your character. In this case I did frame by frame animations with an Anim…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by manuq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants