Looks like you're not logged in

Login or Register to continue

Lesson Q&A

Use this space for questions related to what you're learning. For any other type of support (website, learning platform, payments, etc...) please get in touch using the contact form.

  • General question about code couplingsure-footed-dragonflyHey, I've been trying to implement my project while avoiding my heavy reliance on globals as I know it's dangerous in the long run. So far I've been using the technique described in this lesson [https://www.gdquest.com/tutorial/godot/design-patterns/event-bus-singleton/](https://www.gdquest.com/tutorial/godot/design-patterns/event-bus-singleton/) and it's been working great! but I found that if I ever need to read a variable I'll either have to set up a signal to request it and await the response, or use variable_changed signals and store copies in every object that might later need to know it. I don't like either of these solutions but the only other one I thought of is to have a "query singleton" that has access to everything I need and will only read variables if they exist. This feels not much different that using globals though so i'm not sure if this even helps with coupling. Any ideas on how to go about this better? 3 0 May. 21, 2025
Site is in BETA!found a bug?