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...

Do you use C# since you’re coming from Unity?

You can use GetNode<CustomNode>() or GetChild<CustomNode>() to find the node you need just like in Unity. CustomNode will be the type of your script or if there is no script attached to your node you can use the builtin types as well (e.g. Node3D).

Once you have the node you want, you can either use Godots builtin functions SetMeta() and GetMeta() to set and get metadata on a node or use the C# way and access the public properties set on that CustomComponent class directly.

I don’t use GDScript but I assume you have the same methods available there.