Skip to content

Commit dd45891

Browse files
authored
Merge pull request #4665 from Calinou/gdnative-cpp-init-warning
Highlight requirement to have an `_init` function in GDNative C++ example
2 parents e13ac6f + 6ebe748 commit dd45891

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tutorials/scripting/gdnative/gdnative_cpp_example.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,12 @@ call to find out which methods can be called on our NativeScript and which
255255
properties it exposes. The second is our ``_process`` function, which will work
256256
exactly the same as the ``_process`` function you're used to in GDScript. The
257257
third is our ``_init`` function which is called after Godot has properly set up
258-
our object. It has to exist even if you don't place any code in it.
258+
our object.
259+
260+
.. warning::
261+
262+
The ``_init`` function has to exist even if you don't place any code in it.
263+
Otherwise, the class won't be instantiable.
259264

260265
Let's implement our functions by creating our ``gdexample.cpp`` file:
261266

0 commit comments

Comments
 (0)