Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | victoria-d |
Problem
I’m trying to create a custom Godot module in C++ which contains set()
and get()
methods and I’m having a problem. My methods are not detected by the program, although they do exist, and also I receive this error running it:
ERROR: Class Example already has a method get.
at: bind_methodfi (core/object/class_db.cpp:1297)
ERROR: Class Example already has a method get.
at: bind_methodfi (core/object/class_db.cpp:1297)
Playing with the code, I’ve come to the conclusion that this might be happening because of the Godot’s bind_method()
as once I change it’s first parameter ("set"
) the program starts to detect the related method and works fine.
ClassDB::bind_method(D_METHOD("set", "value"), &Example::set);
Questions
Is there a way to avoid these names changes so I can use my functions as they are? Could the problem be related to the class inheritance:
class Example : public RefCounted { }