the button is not pressed

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Timofey

why, when switching from the menu scene to the game scene and then to the win scene or defeat, the buttons on the last two scenes are not pressed and the sound of defeat or victory is looped, and if you go straight from the menu scene to the win or defeat scene, then all buttons are pressed and the sounds are played only once?

project link: https://drive.google.com/file/d/1r8A-8I3bzRzcCF0UKM85UxomPLunJ7Ay/view?usp=sharing

Where is asteroids.gd global script ?

--- Debugging process stopped ---
 modules/gdscript/gdscript.cpp:829 - Condition "err" is true. Returned: err
 Cannot load source code from file 'res://global scripts/asteroids.gd'.
 Failed loading resource: res://global scripts/asteroids.gd. Make sure resources have been imported by opening the project in the editor at least once.
 Can't autoload: res://global scripts/asteroids.gd.
 editor/editor_autoload_settings.cpp:488 - Condition "!info->node" is true. Continuing.

Scavex | 2020-09-17 18:10

forgot to remove this script from startup.
but it still gives me an error:

E 0: 00: 02.066 emit_signal: Error calling method from signal 'pressed': 'TextureButton :: _ on_Button_pressed': Method not found ..
   <C ++ source code> core / object.cpp: 1260 @ emit_signal ()

Timofey | 2020-09-18 05:05

signal 'pressed': 'TextureButton :: _ on_Button_pressed': Method not found ..

In the error you pasted, there is a space between _ and on. Verify the place where you setup the signal, there should be no space here.

Zylann | 2020-09-18 13:00

it turned out that this is to blame: colider.queue_free()
as a function of the player’s death. I didn’t understand how it affects another scene, but when I did this:
if global.lives > 1: colider.queue_free()

everything worked

Timofey | 2020-09-18 13:59