I wanna pause my game. I tried to do it with this command:
get_tree().set_deferred("paused", true)
This method pause only physics_process function but I need to stop other functions as well. I also tried to do that by changing timescale:
Engine.time_scale = 0
This method works more better then previous one, but in that case I cant use tweens, which I used to animate pause menu, and this method doesnt stop events from pressing keys
Right, call get_tree().paused = true, while modifying process_mode for the pause menu to PROCESS_MODE_ALWAYS to prevent it from being paused.
Thus the children of the pause menu will inherit this configuration since the default value of process_mode is PROCESS_MODE_INHERIT.
I also encountered a tricky issue. When I use get_tree().create_tween(), the tween will be paused, however, the tween won’t be paused if the tween is created with this node.