Hi, I am trying to add an animation to my gun which I use the function called is_playing(). I have some problems with it, also I get an error that says the Node cannot be founded. I am sharing the exact code and images below for your consider, any feedback will be greately appriciated.

`@onready var gun_anim = $Head/Camera/Rifle/AnimationPlayer

func physics_process(delta):
if Input.is_action_pressed("shoot"):
if !gun_anim.is_playing():
gun_anim.play("Shoot")
`

THE ERROR I GET:

E 0:00:00:0966 Player.gd:17 @ _ready(): Node not found: "Head/Camera/Rifle/AnimationPlayer" (relative to "/root/Main/Player").
<C++ Error> Method/function failed. Returning: nullptr
<C++ Source> scene/main/node.cpp:1651 @ get_node()
<Stack Trace> Player.gd:17 @ _ready()


    Are you sure there is no typo in the actual @onready var gun_anim = $Head/Camera/Rifle/AnimationPlayer ? Use the Godot's automatic corrector.
    I replicated your setup and everything works as expected here. I just use .gltf files as a difference.
    In the second screenshot, "Root Node" (in AnimationPlayer) is set to Node, while I normally have it set to Rifle (the real root node).

    6 days later