hello, when I'm placing the codes to program the character animations I get this:

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

invalid set index “animation” (on base: “null instance”) with value of type “string”
that appears to me when I play the scene,
this is my code:

if Movimiento.x > 0:
$animatedsprite.animation = “RUN”
elif Movimiento.y < 0:
$animatedsprite.animation = “JUMP”
$animatedsprite.animation = “NORMAL”

:bust_in_silhouette: Reply From: deaton64

Somehow $animatedsprite, isn’t referencing the animated sprite.
You can use _animatedsprite = find_node("animatedsprite") in your _ready() function, then if you move animatedsprite you won’t have to change your code.

_animatedsprite.animation = "RUN"