Is there a way to stop draw process the same way we do: set_process(false) ?

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

[EDIT: solved the issue by accessing player child node with a singleton setted in project settings > autoload (Global)
in global.gd:

var player_node = null

in player :

func _ready():
    Global.player_node = self

So you can access player child with :

Global.player_node.<child_name>.<whatever_you_want>

that way, even if the player is not fully loaded in the scene, you will not get null instance errors in _draw()]

Hello everybody !

I have a node that need a player child postition to draw some gui around it.

func _draw():
    #draw something

Problem is, the draw function seem to get called before everything else in the scene. So my player has not finished loading every children and the draw function is called anyway.

I search an efficient way of disabling the draw process (something like set_draw(false)).
Because for now it uses an if statement at each draw call which is not very optimized and stable…

I have signals set up to manage such a function.

Thanks for your time