Este video cubre la animación de fotogramas clave 2D en Godot. En Godot 3.1, el sistema de animación recibió una revisión masiva, lo que facilita la creación de animaciones complejas utilizando fotogramas clave. Este video muestra cómo usar AnimationPlayer, AnimationTreePlayer y el sistema de animación, en general, para crear y combinar animaciones en Godot.
El video
Ejemplos de código
KeyframeAnimation.gd
extends Node2D var counter = 0 func _process(delta): if Input.is_key_pressed(KEY_B): if $AnimationPlayer.is_playing() == false: $AnimationPlayer.play("bounce") print("Bouncing") if Input.is_action_just_released("one"): $AnimationTreePlayer.active = true var val = $AnimationTreePlayer.blend2_node_get_amount("blend2") if(val >= 0.1): $AnimationTreePlayer.blend2_node_set_amount("blend2",val -0.1) if Input.is_action_just_released("two"): $AnimationTreePlayer.active = true var val = $AnimationTreePlayer.blend2_node_get_amount("blend2") if(val <= 1): $AnimationTreePlayer.blend2_node_set_amount("blend2",val + 0.1) counter += delta if counter >0.1: if $AnimationPlayer.is_playing(): print("Cur anim time remaining " + str($AnimationPlayer.current_animation_length - $AnimationPlayer.current_animation_position)) counter = 0