#How to see when animation finishes?
13 messages · Page 1 of 1 (latest)
func _ready():
gun_animation.animation_finished.connect(on_animation_finished)
func on_animation_finished(_arg):
where the _arg is the name of the animation that was finished. So if you have an animation called "shoot" and animation called "reload" it will be called for both so you might want to do a check if you only want logic to happen for one or the other
patientSprite.animation_finished.connect(on_animation_finished) func on_animation_finished(_arg):
if _arg == "animation1":
print("yes")
else:
print("no")
is this how? bcuz nothing is happening
Maybe 🤔
patientSprite.connect(on_animation_finished) func on_animation_finished(_arg):
if _arg == "animation1":
print("yes")
else:
print("no")
@onready var animated_sprite: AnimatedSprite2D = $AnimatedSprite2D
func _ready() -> void:
animated_sprite.animation_finished.connect(func():
if animated_sprite.animation == &"animation1":
print("yes")
)
You can't connect a node, must be a signal!
How do you get _arg?
this also isn't working
If it doesn't work, it is because you did bad your animation config. You must disable loop. If loop is enable, then animation doesn't finish. 
holy shit you're right thank you so much
No problem