0
\$\begingroup\$

I'm making a mobile game in the Godot game engine. I made a spike scene where the spikes will respawn at a random time in a particular position moving upwards. Then I instanced the scene in the main scene, it worked perfectly, the spikes moving up and appearing in a particular position. Then I created a TouchScreenButton node in the main scene and changed it pause property to process and then added a _OnPressed and _OnReleased signal to the main scene script then added this code to the _OnPressed function get_tree().paused = true And added this code to the _OnReleased function get_tree().paused = false

But when ever I press and release the button it only pauses the scene

What should I do?

\$\endgroup\$
1
  • \$\begingroup\$ Are you saying it does not unpause? Or are you saying there is something that should pause but doesn't? By the way, if you have a shader that uses TIME they do not pause. You might also be interested in Engine.time_scale which will affect such shaders. \$\endgroup\$
    – Theraot
    May 20 at 4:48
0
\$\begingroup\$

The main node will not be able to receive signals when the tree is paused and it's pause mode is set to inherit. You should handle the signals in a node that has it's pause mode set to process.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.