-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document migration from 3.x for AnimationPlayer.add_animation #86611
Comments
You need to use the Instructions for this should be added to this page, which arguably makes this an issue for the documentation |
May I ask how could I use get_animation_library to add new animation frame? func setup_animations(data: Dictionary) -> void:
var anim_library = animation_player.get_animation_library("")
for anim_name in data["animations"].keys():
var anim = Animation.new()
anim.length = data["animations"][anim_name]["frames"].size() * 0.05
var track_index = anim.add_track(Animation.TYPE_VALUE)
for frame in data["animations"][anim_name]["frames"]:
var frame_number = frame["y"] * sprite.hframes + frame["x"]
var frame_time = frame_number * 0.05
anim.track_set_path(track_index, String(sprite.get_path()) + ":frame")
anim.track_insert_key(track_index, frame_time, frame_number)
anim_library.add_animation(anim_name, anim)
animation_player.set_animation_library(anim_library) |
You can't set it, you just update it directly, see the documentation No need to call any set method (there isn't one, you can have multiple libraries) |
But while the documentation for migration from 3.x should mention this I'd say that you should ask in the other community channels for support 🙂, this is for reporting bugs |
Let's keep this open to handle the documentation, or open one on the documentation page |
Tested versions
Windows 10 - Godot_v4.2-stable_win64
System information
Windows 10 - Godot_v4.2-stable_win64
Issue description
When I try to use add_animation in AnimationPlayer, it looks like doesn't have it anymore. Is it changed to others?
Steps to reproduce
$AnimationPlayer.add_animation
Minimal reproduction project (MRP)
animation_player.add_animation(anim_name, anim)
The text was updated successfully, but these errors were encountered: