cak3_lover
cak3_lover

Reputation: 1958

How to invoke a function on unpausing the tree?

Is it possible to invoke a function or connect a signal when the tree is unpaused?

for example I have this setup:
enter image description here

the world script:

extends Node2D

func _ready():
    get_tree().paused=true
    
    # do something
    
    get_tree().paused=false

the thing script:

extends Node2D

func _unpaused():
    # reset something when the tree is unpaused

is something like this possible?

Upvotes: 0

Views: 229

Answers (1)

Theraot
Theraot

Reputation: 40315

No, I can't find a signal or virtual method for that.

I'd say use an autoload that controls paused, and make sure everything on the projects that needs paused goes through the autoload. So the autoload can do whatever you need when it changes.

Upvotes: 1

Related Questions