Godot Version
4.2.1
Question
I am a beginner currently following a tutorial on YouTube making a platformer. However, in the tutorial, the person used an Animation player to play a level transition animation. When I try to do the same thing, Godot tells me that it is unable to find the Animation player despite the Player being a child node of the parent node in which the script is based. What might be causing this? Thank you.
Did you save your scene? (it has an asterix next to the name)
Not sure, can’t really tell. Perhaps add your onready var again?
Select and drag your AnimationPlayer from the scene tree and then holding Ctrl drop it into you codeblock.
No luck. As for the @onready, I already ctrl dragged it.
I would’ve atleast expected to see this:
@onready var animation_player: AnimationPlayer = $AnimationPlayer.
what is the code from where you are calling leveltransition?
and what happens if you replace animation_player variable in your function to $AnimationPlayer? so $AnimationPlayer.play