godotengine / godotengine/godot-cpp
Using NodePath editor hint with NativeScript
- Dominant language
- C++
- Stars
- 2.7k
- Forks
- 809
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 8
Description
So I am currently trying to replicate some like this with GDNative:
```gdscript
export(NodePath) var sample;
```
Desired Result:

Here is what I've been testing, but it doesn't seem to get what I am looking for.
```cpp
register_property("sample", &SampleClass::sample, "", GODOT_METHOD_RPC_MODE_DISABLED, GODOT_PROPERTY_USAGE_EDITOR, GODOT_PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE);
```

Since `NodePath` is not a valid type for register_property, my thought is I could have used a string with the editor hint and convert it in my code.
I've also tried using a setter and getter, but I am guessing there is an alternative to `GODOT_PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE` or something entirely outside of `register_property` I should be looking for.
Any suggestions or guidance would be amazing appreciated!!! :smile:
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.