Highlight requirement to have an _init function in GDNative C++ example

This commit is contained in:
Hugo Locurcio
2021-02-19 21:54:43 +01:00
parent c1faa5d976
commit 6ebe74850a

View File

@@ -255,7 +255,12 @@ call to find out which methods can be called on our NativeScript and which
properties it exposes. The second is our ``_process`` function, which will work
exactly the same as the ``_process`` function you're used to in GDScript. The
third is our ``_init`` function which is called after Godot has properly set up
our object. It has to exist even if you don't place any code in it.
our object.
.. warning::
The ``_init`` function has to exist even if you don't place any code in it.
Otherwise, the class won't be instantiable.
Let's implement our functions by creating our ``gdexample.cpp`` file: