When creating a ::godot::Node
we should use memnew
instead of new
. I have made a subclass of Node3D
that has two constructor parameters. I tried to create an instance with
memnew (MySubclassOfNode3D {x, y})
This fails, because memnew
is a macro, and to the C++ preprocessor this is a macro call with two arguments, rather than one.
How do I create an instance of my class? Thanks!