5354d8b30f
- Added tekton_fishing_autoplay.gd: plays both GLB animations simultaneously, looped - Attached autoplay script to 3 fishing tekton instances in freemode.tscn - Fixed static tekton throw: faces throw direction + plays throw animation - Fixed AnimationPlayer path in tekton.gd for static turrets - Fixed animation names (tekton_throw_tile -> ted_bones_001|Tekton Throwing Tiles|Anima_Layer) - Fixed static_tekton_controller.gd idle resume - Rebuilt animation-pack.res with new animations (holding_1, put_1, stun_1, etc.) - Fixed GutBottomPanel.tscn broken UID
26 lines
829 B
GDScript
26 lines
829 B
GDScript
extends Node3D
|
|
|
|
## Autoplays all animations in the AnimationPlayer simultaneously and loops them.
|
|
## Attach to any node that has an AnimationPlayer child (e.g. tekton_fishing_animation instances).
|
|
|
|
@onready var anim_player: AnimationPlayer = $AnimationPlayer
|
|
|
|
func _ready() -> void:
|
|
if not anim_player:
|
|
push_warning("tekton_fishing_autoplay: No AnimationPlayer found")
|
|
return
|
|
|
|
# Wait one frame for the scene tree to settle
|
|
await get_tree().process_frame
|
|
|
|
# Play every animation simultaneously, all looping
|
|
for anim_name in anim_player.get_animation_list():
|
|
anim_player.play(anim_name)
|
|
anim_player.advance(0.0) # ensure it starts
|
|
|
|
# Set all to loop
|
|
for anim_name in anim_player.get_animation_list():
|
|
var anim: Animation = anim_player.get_animation(anim_name)
|
|
if anim:
|
|
anim.loop_mode = Animation.LOOP_LINEAR
|