Conversation
When the SpriteFrames animation doesn't have an animation named "walk", use its "idle" animation for walking. This makes the modding easier, since a single animation is now needed for start testing a SpriteFrames in a character with any of the walk behaviors. We also use "idle" at double speed for running. And also, when a character is made of multiple parts, some parts can stay in the "idle" animation. Meaning there are less parts to draw.
The townies "idle" has a subtle up and down animation. For a character made of parts, since the last commit one part (like the head) may keep playing "idle" while another (like the legs) may play "walk". But when the character is back to idle, all parts should be set in sync again. Otherwise, the head may go up when the legs go down, making a funny but not desired (for now) dance.
Assets: - Rename existing part assets to "idle". - Add walk animation for the legs part. RandomTextureSpriteBehavior: - Export an Array of SpriteFrames resources. Instead of using the custom addon to change the textures. Townie scene: - Add a CharacterSpriteBehavior to each part. And configure the legs part with the new animations. - Add one .tres file per body part variant. And configure each Array of SpriteFrames resources with them. Townie demo: - Add a FollowWalkBehavior to one townie, and remove the TalkBehavior.
|
Test build no longer available. |
recording.webmAnd this is the funny bug I've been fighting today live on Discord: Grabacion.de.pantalla.desde.2026-04-27.18-47-25.mp4The lower part of the body is out of sync after a walk. This was fixed by resetting frame and progress of all animations when back to idle (either if they are reusing the idle animation when walking or not): |
|
If I find time today/tomorrow I will also animate the body and hair (skipping the faces) for the walk cycle. |
wjt
left a comment
There was a problem hiding this comment.
This is great. Having walking animations for townies will make it much easier to make the world feel alive.
| sprite.sprite_frames = new_sprite_frames | ||
| if not Engine.is_editor_hint(): | ||
| if previous_animation in sprite.sprite_frames.get_animation_names(): | ||
| sprite.play(&"idle") |
There was a problem hiding this comment.
Is this supposed to be re-playing previous_animation? If not I don't quite understand what the previous_animation check is for.
There was a problem hiding this comment.
You are right, this should be the previous_animation
RandomTextureSpriteBehavior: Allow idle + walk animation
Assets:
RandomTextureSpriteBehavior:
to change the textures.
Townie scene:
Add a CharacterSpriteBehavior to each part. And configure the legs part with
the new animations.
Add one .tres file per body part variant. And configure each Array of
SpriteFrames resources with them.
Townie demo:
CharacterSpriteBehavior: Reset frames when back to idle
The townies "idle" has a subtle up and down animation.
For a character made of parts, since the last commit one part (like the head)
may keep playing "idle" while another (like the legs) may play "walk". But when
the character is back to idle, all parts should be set in sync again. Otherwise,
the head may go up when the legs go down, making a funny but not desired (for
now) dance.
CharacterSpriteBehavior: Fallback to idle when walk is not available
When the SpriteFrames animation doesn't have an animation named "walk", use its
"idle" animation for walking. This makes the modding easier, since a single
animation is now needed for start testing a SpriteFrames in a character with any
of the walk behaviors. We also use "idle" at double speed for running.
And also, when a character is made of multiple parts, some parts can stay in the
"idle" animation. Meaning there are less parts to draw.