All Questions


Guy Bachelier
posted to: Coding the Coin

Animate the sprite

Hi Nathan, Does iut sounds normal to move the animatio non the sprite and not on CollisionShape2D ? I imagine that in a platform 2D I'll need tomake the collisionshape2D moves with the sprite ? Is it correct "design" to creat a tre with a node at the root ?
  • Nathan Lovato replied

    It depends a lot on your game. Sometimes you can animate the parent node. For example, if you want to create a moving platform. Since Godot 3.2, you have some built-in features to do that with the animation player.

    In other cases, you'll want to animate a sprite, etc. In this case, we chose to have the animation on the sprite because it has a small amplitude and it's only cosmetic. Animating the KinematicBody2D node, that is to say, the entire Coin, would be another valid option.