I’m making a minigame for my game that can be paused, and I was wondering how exactly hide()/show() work. What exactly is the underlying code or these and do these functions automatically set the process mode to disabled (or something similar), or do I still need to set it manually?
each node has a process mode that is set to inherit by default, meaning they will have the same mode as the parent node.
the root node is usually set to pausable, so all nodes are pausable.
you need a node with children, preferably a scene, where you set the first node to when_paused or always, so the children will inherit these. one common case is a menu that is displayed when the game is paused.
then you can do:
get_tree().paused = true
this pauses the game. so, you show your whenPaused scene (a menu or a single button) and then pause, and you will be able to do things there while the background is paused.
make sure to set nodes that must always run to always, like something that holds score that must be read by both the menu and the game.
you can also set a node to process mode disabled to prevent all process from happening, this is usually changed by code during game.