All I want is to trigger an animation called "dead" on the player after he enters an Area2D.
So I got this code on the Area2D:
extends Area2D
func onDeadZonebodyentered(body):
if body.isingroup("player"):
body.dead()
And this code on the player:
func dead():
$AnimatedSprite.play("dead")
yield($AnimatedSprite, "animationfinished")
gettree().change_scene("res://scenes/screens/GameOverScreen.tscn")
even though godot is waiting until the animation is finished before loading the next level the animation itself is not playing
I just don't get this one :D
All I want is to trigger an animation called "dead" on the player after he enters an Area2D.
So I got this code on the Area2D:
extends Area2D
func onDeadZonebodyentered(body):
if body.isingroup("player"):
body.dead()
And this code on the player:
func dead():
$AnimatedSprite.play("dead")
yield($AnimatedSprite, "animationfinished")
gettree().change_scene("res://scenes/screens/GameOverScreen.tscn")
even though godot is waiting until the animation is finished before loading the next level the animation itself is not playing.
I just don't get this one :D smb. help please ...