How to save "meta" information in a scene

How to save "meta" information in a scene

https://gehirneimer.de/m/godot@programming.dev/t/275555

How to save "meta" information in a scene - Godot - GehirnEimer

I am coming from a Unity background and there I just had a component of some custom class in the scene which I could then easily get by calling `FindInScene<CustomComponent>` or something like that. Not in Godot this doesn't work, because I didn't find a way to get the actual class of an attached script. I always just get...

You may find some value in Groups. This lets you assign a node to a group by name, then later get the nodes in the group by searching for that name.

In your specific example you mention being able to fetch the spawn points. I’d add each spawn point to a group called “spawn” and then later retrieve them with:

var spawn_points = get_tree().get_nodes_in_group(“spawn”)

Groups

Groups in Godot work like tags in other software. You can add a node to as many groups as you want. Then, in code, you can use the SceneTree to: Get a list of nodes in a group., Call a method on al...

Godot Engine documentation
Interesting. I heard about groups, but I didn't really look into them, yet. Seems I gotta read up a little more :D
I find them very handy. I also came to Godot from Unity, and groups almost work identically to Unity’s FindAllInScene()<> method. You just have to do a little setup to give them a string instead of searching for class type, but they behave very similarly.