so I been following some YouTube videos since this is my first time trying to code or develop anything. I'm stuck at a certain part where I'm trying to get and apple to fall from a tree. I created 2 animations. the original fall, and a fade. when I type the code in, and run the game, as soon as i click the tree it crashes my game prompting this code.
E 0:00:04:0850 apple_collectible.gd:9 @ fallfromtree(): Node not found: "AnimationPlayer" (relative to "/root/world/apple_collectible").
<C++ Error> Method/function failed. Returning: nullptr
<C++ Source> scene/main/node.cpp:1638 @ get_node()
<Stack Trace> apple_collectible.gd:9 @ fallfromtree()
apple_collectible.gd:6 @ _ready()
apple_tree.gd:39 @ drop_apple()
apple_tree.gd:19 @ _process()
I've followed everything to the video to this point and of course the video works and mine doesn't lol.
This is what my code is.
func _ready():
fallfromtree()
func fallfromtree():
$AnimationPlayer.play("fallingfromtree")
await get_tree().create_timer(1.5).timeout
$AnimationPlayer.play("fade")
print("+1 apples")
await get_tree().create_timer(0.3).timeout
queue_free()
Any help will be greatly appreciated!
