godotengine / godotengine/godot-docs

Missing example to connect signal in GDNative C++ code

Open
#3,360 4 comments 0 reactions 0 assignees View on GitHub
area:manual bug
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

I've read and replicated the example described in [gdnative-cpp-example.rst](https://github.com/godotengine/godot-docs/blob/master/tutorials/plugins/gdnative/gdnative-cpp-example.rst#signals) but I can't successfully connect a function to a signal in C++ source code. It just says
`some_other_node->connect("the_signal", this, "my_method");`
I tried to add
`get_node("Reset")->connect("pressed", this, "on_Reset_pressed");`
in both _init and _ready. In the first case it returns an error because it can't find the node (Reset is a Button) and the second doesn't seem to do anything. Where should I put the connect call?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.