I need help with exporting animation player

Godot Version

Godot 4


I’m trying to make an animation of the player play in the main scene when he enters an area, the animation is the player scene and I tried to export it so I can use it in the main scene script, every time I use the .play() function it says that it doesn’t exist and I don’t know why.

that is the main scene script
and for the player scene the variable i have is @onready var anim = %AnimationPlayer

it’s better to just use signal to tell the player to do the player animation of “DoorAnim”, rather like this

or if you insist of doing it like this way
erase the

var animation=player.anim

replace with:


then in the player script
add a method that takes parameter of string

func play_animation(string_anim):

if this way still say the anim doesnt exist, then something is wrong with how you path/name the animationplayer

Nothing happened yeah but how do I use signal to tell the player to do the animation

use Global EventBus