

Removed by mod
Removed by mod
Removed by mod
Removed by mod
Removed by mod
Removed by mod
Removed by mod
Removed by mod
We don’t have generics in gdscript unfortunately, there’s a whole thread discussing about it here. You’d need to either have this piece of code in every place you want to retrieve the component, or you could have a static function in the component class that takes a node as a parameter and checks if it has children nodes of the correct type. Then it can return the correct type node as well and should be fully type safe. But you need to have this static function on each and every component class, which I think you can’t overcome without generics.
Removed by mod
Removed by mod
Removed by mod
Dude, my company has just been acquired by another one. This is me every day now for the next couple of months.
I’m missing the joke… would anyone be so kind to help me understand?
It’s a good practice to adhere to proper design patterns even on smaller projects. I also work solo on small projects :). It doesn’t really cost you anything to work with classes, it’d even say it’s easier once you get a hang of it