"Node not found" when accessing frame from spritesheet during animation

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By glenn.julian25


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:


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”).)

_ensure_node_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.

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?

clownshoe | 2021-06-20 00:15