Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(2 edits) (+1)

Die Kran Animation ist im Grunde bloß ein AnimatedSprite2D aus acht frames die ich mit einem kleinen Skript animiert habe.

Dazu warte ich einfach ab wenn die Animation beendet wurde, warte einen weiteren kleinen Moment und spiele die Animation einfach rückwärts ab. Danach ruft die Animationsmethode sich selbst auf und das ganze läuft für immer weiter.

Codebeispiel:

@onready var hook: AnimatedSprite2D = $ResourcePile/Hook

func _ready():
     _play_hook_animation()
	
func _play_hook_animation():
	hook.play("hook")
	await hook.animation_finished
	await get_tree().create_timer(1.5).timeout
	hook.play_backwards("hook")
	await hook.animation_finished
	await get_tree().create_timer(1.5).timeout
	_play_hook_animation()
(+2)

sehr geil, ich verstehe, einzelne komponente =D