From 6ebe74850a96bdaea6cbda8aafc47fe522db3849 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 19 Feb 2021 21:54:43 +0100 Subject: [PATCH] Highlight requirement to have an `_init` function in GDNative C++ example --- tutorials/scripting/gdnative/gdnative_cpp_example.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tutorials/scripting/gdnative/gdnative_cpp_example.rst b/tutorials/scripting/gdnative/gdnative_cpp_example.rst index ea89a64a9..32053c3e4 100644 --- a/tutorials/scripting/gdnative/gdnative_cpp_example.rst +++ b/tutorials/scripting/gdnative/gdnative_cpp_example.rst @@ -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: