Godot Version
4.22
Question
Hello,
I’m entirely new to Godot and following Brackey’s “How to make a Video Game - Godot Beginner Tutorial”.
How to make a Video Game - Godot Beginner Tutorial
Instead of having the player body fall through a platform, I want to insert a death animation which I have already inserted the sprite frames for in the AnimatedSprite2D child node under the Player scene. The idle, run and jump animations are accessed through the Player scene script, but the killzone that Brackey introduces is a different scene. I tried replacing the line of code that causes the player to fall through blocks when dying with:
body.get_node.(“AnimatedSprite2D”).play(“death”)
This doesn’t work the same way as the line of code used in the player scene script:
animated_sprite_2d.play(“idle”)
Otherwise, I’m not sure how I’d access the same function used in the Killzone scene in the Player scene with an if statement to trigger the death animation, or how to access the sprite animations from the Killzone scene.
I’m not sure how to go about this. Still very new to all this, so any help is really appreciated!
Thank you.
Killzone scene script:
Player scene script: