Animation player not finding my nodes

Godot Version

4.2.1

Question

I have an animation player animating the rotation, scale, and visible of a custom class extending Characterbody2D. This node is the root of my scene, and I am getting an error for each track saying that it can’t find the property of my node using get_node. Everything else not related to animation seems to be working though. Here’s an image for reference.


This might be because you are using colons for position, scale, and visibility? I haven’t used the AnimationPlayer node that much, but I know that in GDScript, periods are used for properties.

@Opalion No, that is normal. While you’re right that one would use a period when directly changing a property in GDScript, if you do it indirectly (via a Tween or AnimationPlayer) you have to provide a property path instead, which is using colons instead of periods.

@Just_Me_I_Guess How exactly does your scene tree look like? The errors tell you that your main scene “Node2D” has no child node named `PlayerCharacter2d" when the animation is playing. Might be because it wasn’t created yet or has already been free’d or the node was simply renamed. Check your scripts for any of that!

2 Likes

@njamster Here’s the tree:
Godotanimationerror1

Godotanimationerror1

Also, here’s the reset track on the animationplayer. Since the errors are coming for the reset track, as well as the other tracks, I think this might be enough.
Godotanimationerror2
Also, I forgot to mention this, but the animations work in the editor.

Player in 2nd image (Starts at Node2d) is the main scene, while first image is the local scene.

So, I think I found the problem. I hadn’t set the root node for the animation player.

1 Like