GDExtension REGISTER_RUNTIME_CLASS

Godot Version

4.3

Question

Does anyone have a link to some documentation on what this does in godot 4.3 ? It seems that classes registered with it cannot be used in the editor. I was under the impression that they would just not be executed while in the editor… so _physics_process() would not need the if (Engine::get_singleton()->is_editor_hint()) return; line to stop it executing if not at runtime but it seems not.

When I registered classes using it (after upgrading my project from 4.2 to 4.3) godot complained that it could not see those classes.

Assuming you meant GDREGISTER_RUNTIME_CLASS(), using GDREGISTER_CLASS() should do that.

Yes, but what is it that GDREGISTER_RUNTIME_CLASS should do ? If the godot editor cannot see the class, then what is it’s use case ?

Works intended for me, weird

Just a node that activates its methods only at runtime, for example, if you created a new Node type class that overrides _ready(), _ready() would be called in the editor and runtime with GDREGISTER_CLASS(). With GDREGISTER_RUNTIME_CLASS() _ready() will only be called at runtime.

see their example in the release notes: Godot 4.3, a shared effort

1 Like

Thanks Tirt… Yes, that is what I thought it should do. I’m guessing I mucked up in migrating my repository from 4.2.1 to 4.3 somewhere. I shall give it another go.

I restarted from scratch and this time it built OK. Thank you Tirt.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.