Closed RonYanDaik closed 7 months ago
You can already create class instances by their names, provided they are properly registered within the ClassDB.
SomeCustomClass* some_instance = godot::Object::cast_to<SomeCustomClass>(godot::ClassDB::instantiate("SomeCustomClass"));
Sounds like we can close this one because @Kehom explains how to do this. :-)
Thanks @Kehom!
Godot version
4.x
godot-cpp version
4.x
System information
Win
Issue description
Since
ClassDB
already storesClassInfo
which has a template of_create_instance_func
it looks like its possible to create an instance of class using its name but its hidden in private field.Would be useful to add an public function for this.
Steps to reproduce
-
Minimal reproduction project
-