gdnative c++ how to gall function in a different nodes gdscript

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Raging_Panda

Called the gdnative code from gdscript is easy

get_node("node_location").function()

but how do I do the same in gdnative.

The tutorials and documentation has no example.

It has an example of emitting a signal which i could use but I’d prefer the function call.

:bust_in_silhouette: Reply From: sash-rc
get_node("node_location").function(1, 2, 3) # gdscript

get_node("node_location")->call("function", Array::make(1, 2, 3)); // c++

For a gdnative (c++) node you can call function directly (nor you don’t have to register it)

MyNodeClass* node = Object::cast_to<MyNodeClass>(get_node("node_location"));
node->function(1, 2, 3);