This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

Hello,

I am trying to create a program where the player character will display certain animations upon walking right, left, down, or up. While the movement capabilities are present, the animations are not. Here are the relevant scenes: 

Node2d
--->KinematicSprite
------>Sprite
------>AnimationPlayer

I imported the spritesheet, set all the frames in Sprite, and made all the animations in the AnimationPlayer.

In the KinematicBody's script, I tested for each key press and used $AnimationPlayer.play("specific animation name") to play the animation unique to the respective direction.

When I run the program, the player starts in the IdleRight animation (just looking to the right– there's only 1 frame here), but when I make the character move, it stays in this idle state regardless of which direction I move it in.

Without pressing any buttons, I get the following errors:

get_node: (Node not found: "KinematicBody2D/Sprite2:frame" (relative to "/root/Map/KinematicBody2D").)

ensurenode_caches: On Animation: 'IdleRight', couldn't resolve track: 'KinematicBody2D/Sprite2:frame'.

When I test up and down motion, the same 2 errors repeat. Oddly enough, this doesn't happen when I test left and right, even though the left and right animations aren't playing. Please let me know if any more information would be helpful.

Godot version 3.3.2 stable
in Engine by (12 points)

We can probably find the issue more quickly with some code.
Are you pro grammatically adding the animations? or you've done this inside the editor?

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.