Process Priority of Auto Loads / Singletons?

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

Is it possible to set the order that the _process function gets called in auto loaded objects compared to everything else? When adding nodes to the editor, their priority can be changed with Process Priority in the inspector. Is there an equivalent for singletons?

:bust_in_silhouette: Reply From: njamster

Add the following to your singleton-script:

func _ready():
    process_priority = -100

The lower the number, the higher the priority. You can hover over any property in the inspector to see it’s name and access it from GDscript using that.

Edit: process_priority not process_property

There’s a typo in the code sample. It should be process_priority, not process_property.

Calinou | 2020-07-16 10:17

Thank you, good catch! :slight_smile: I corrected my answer.

njamster | 2020-07-16 11:50