0 votes

Hi everyone,

I've been playing around with the MainLoop Type to override de standard SceneTree just by creating a gdscript that extends MainLoop and giving a class_name to it. However, I was wondering, is it possible to do this from a gdnative script created in c++? Do I need any modifications to the standard process of creation of the gdnlib from the tutorials?

Godot version 3.5.beta
in Engine by (71 points)

1 Answer

0 votes

First, GDNative objects are actually a wrappers for an internal Godot's object instances. So you cannot "override" its unexposed core behavior, for this you need to use a module.

As of normal use of callbacks like _init, _ready, or whichever ones given type is supporting, all GDNative classes (incl. MainLoop) are resembling its GDScript counterparts, so yes, it should be possible.

by (1,648 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.