diff --git a/engine_details/architecture/object_class.rst b/engine_details/architecture/object_class.rst index ffa69908cbf..8ddf73a0788 100644 --- a/engine_details/architecture/object_class.rst +++ b/engine_details/architecture/object_class.rst @@ -227,12 +227,15 @@ languages). This example shows how to connect to them: .. code-block:: cpp - obj->connect(, target_instance, target_method) - // for example: - obj->connect("enter_tree", this, "_node_entered_tree") - -The method ``_node_entered_tree`` must be registered to the class using -``ClassDB::bind_method`` (explained before). + // This is the function signature: + // + // Error connect(const StringName &p_signal, const Callable &p_callable, uint32_t p_flags = 0) + // + // For example: + obj->connect("signal_name_here", callable_mp(this, &MyCustomType::method), CONNECT_DEFERRED); + +``callable_mp`` is a macro to create a custom callable function pointer to member functions. +For the values of ``p_flags``, see :ref:`ConnectFlags `. Adding signals to a class is done in ``_bind_methods``, using the ``ADD_SIGNAL`` macro, for example: