Is there a way to play an animation from a saved .tres/.res/.anim file?

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

I have an actor scene which is being loaded into my main scene. I have a seperate “hero” scene which contains the player sprite, the name of the hero, and the animation. I saved the animations in all three forms available for testing (.tres,.res,.anim).

My issue is I can get all the data EXCEPT the animations. I am not sure if my best route would be to instance the scene, but I am not sure how I would go about doing that because preloading only takes a constant path and the path I would need would be something like… "res://Scenes/Heroes/",name,"/",name,".tscn".

I thought I had got it working, no errors on startup, but when I print the current_animation i get an empty string returned. The most recent solution I had tried was $ActorMovement.set_current_animation(str("res://Scenes/Heroes/",name,"/",name,"Up.res"))

Which only throws the error play: Animation not found and the path is correct in the error. I am assume that’s because the set_current_animation function can only take animations created on the AnimationPlayer on the current scene? I am at a loss, any insight would be nice though!