i have 2 position keyframes and i want to set them in code
i dont understand what to type in track_id and key
problem setting track key values from code
- Edited
- Best Answerset by 420mangojuice
If you look through the Animation method descriptions, there are methods that return a track index or key index:
https://docs.godotengine.org/en/stable/classes/class_animation.html#methods
Examples: find_track(), track_find_key()
8 days later
- Edited
if any future peoples also having the same issue here is how i did it
#track_set_key_value(track_id,key,value)
#track_find_key(track_id,time)
#finds_track_idx
var animation=$AnimationPlayer.get_animation("walk_right")
var x=animation.find_track("right_walk_sprite_sheet:position")
print(x)
#finds_key
var animation=$AnimationPlayer.get_animation("walk_right")
var x=animation.track_find_key(1,1.4)
print(x)
420mangojuice Did you mean to comment(#) every single line there?
Megalomaniak i fixed it