How to dynamically add Animation Libraries to an Animation Player

Godot Version

Godot 4.3 .NET

Question

` Hello! I am trying to add an animation library to a player depending on what character is being used. So for example I have declared the Animation Library in the character data and would like to add that Animation Library to the player on ready depending on what character is used.

Thanks, I can post any relevant code but I haven’t really written much to attempt this outside of trying to play around with AddAnimationLibrary() which doesn’t seem to be working for this.

I know this is a lazy response but this is how I did it for my game , most if it you dont need except the beginning and the end

var transition_animation :Animation = Animation.new()
var animation_libary :AnimationLibrary = anim_player.get_animation_library("")


var save_result = ResourceSaver.save(animation_libary,"res://" + animation_libary.resource_name + ".tres") # save the animation so I can dink with it .