animation_path : String— Path to.jsonor.lottiefileplaying : bool— Animation playback stateautoplay : bool— Start automatically when readylooping : bool— Loop when reaching endspeed : float— Playback speed (1.0 = normal)fit_box_size : Vector2i— Display sizeoffset : Vector2— Drawing offset for pivot adjustment
play()— Start/resume playbackstop()— Stop and reset to frame 0pause()— Pause at current frameseek(frame: float)— Jump to specific frameget_frame() -> float— Current frameget_duration() -> float— Duration in secondsget_total_frames() -> float— Total frame count
animation_finished()— Emitted when non-looping animation endsframe_changed(frame: float)— Emitted on frame changeanimation_loaded(success: bool)— Emitted after load attempt
var lottie = $LottieAnimation
lottie.animation_path = "res://animation.json"
lottie.autoplay = true
lottie.looping = trueCheck out demo/addons/godot_lottie/demo/controldemo.tscn for a working example with UI controls:
- Play/Stop buttons connected to
LottieAnimationmethods - Runtime control of animation playback
- Simple setup showing basic integration
# UI buttons for animation control
@onready var play: Button = $play
@onready var stop: Button = $stop
# Reference to the Lottie animation node
@onready var lottie: LottieAnimation = $LottieAnimation
func _on_play_pressed() -> void:
lottie.play()
func _on_stop_pressed() -> void:
lottie.stop()State Machine API coming soon