I’m trying to make it so that upon touching the enemy, all movement will stop, the player character will play an animation, then the game would restart. The detection and pausing node is a scene in the enemy scene, which is then put in the main scene. So far, the game stops when touching the enemy. However, I’m struggling to make the player character do the animation. I’ve tried using signals, but all the solutions I found were either outdated or not helpful.
…Am I doing this right? I never did a forum question before…
If you’re using an AnimationPlayer (you didn’t specify), use play(“animation”) and then is_playing() to check if the animation is finished before doing something else like ending the game. Ideally this animation should not be set to loop so that it will end.
Can I see the code you use for pausing the node?
My guess is that you are also pausing the player node which stops all processing in the player script.
I’m having trouble getting the player node to detect the game is paused or getting Pain to send a message. The only time the player and Pain nodes are together is in the Main scene where the Pain is compacted in the Enemy, getting rid of most of the ideas shown in tutorials.
And the only nodes I’m using for animation are the AnimatedSprite2D and CharacterBody2D of the player character.