#godot #gdscript #csharp

Does anyone know it I can access a class_name global script from within a c# class when using Godot?

I have a global autoload from a my_global.gd file with a class_name of MyGlobal that is assigned to the global of "g".

I can get the node "/root/g" from within c# but I don't seem to be able to do something like GetNode<MyGlobal>("/root/g").

GDscript on the other hand has no problems instantiating my [GlobalClass] c# classes.

Here are some insights after a bit of testing.

Node g = GetNode("/root/g");
g.Call("method_name",args);

works.

var my_variable = g.Get("my_variable");

works as well.

What does not seem to work is to get some kind of automatic class wrapper for the custom classes.

I am thinking of writing a editor plugin that writes a wrapper c# class every time a class_name gets updated in the ProjectSettings.get_global_class_list().
Will test it with some manual wrappers first.