Hello!

Recently i realized, that singleton (Autoload) as a "data manager" will resolve most of my problems in my project. Only problem now is that i dont know how to connect signal from and to Singleton. I tryed to connect it using "node.connect("signal", self, "function_name")", but i dont know how i can get this "node". Probably i searched in wron places, but i didn't find any useful information.

So i'm asking there: How i could connect signal from scene to singleton? is it possible at all? * If it is not possible, how i can realize same actions witout using signals?

I will be very tankful for any information that will help to understand how to solve this problem :)

Your singleton must have a name (let's say DataManager). To connect a signal to it, use the following : DataManager.connect("signal", self, "function_name").

Now i can solve most of problems with singleton and signals. But, just to avoid creating lot of loops in singleton, is there a way to connect signal from scene to singleton? for example: In active scene something happened, and signal with some data has been emited --> Singleton catch this signal, read data from it, make calculations and emit own signal --> Active scene catch signal from signgleton, read signals data, and do things based on incoming data. This is not madatory, but that would be helpful.

7 days later

May be it will be helpful for someone. Recently i understanded that i can call function in singleton from any point of my game, and it will do same functions as a signal. It will look something like that: In active scene call Singleton function DataManager.compute_something( parametrs ) Singleton function will run function with entered parametrs and send a signal to everyone who needs the result. ( you can also check result from scene, but i think its easyer to do it by using signal ) DataManager.connect( singletonSignal, target, "FunctionInScene" )

It is just a discovery for me, so i describet it there, maybe it will be useful for someone :D

a year later