godot: GDExtension error: Condition "_instance_bindings != nullptr" is true.
Godot version
4.0.dev (0ce3fff)
System information
Debian GNU/Linux bookworm/sid 64-bit, NVIDIA GM206 [GeForce GTX 960] (driver v470.103.01)
Issue description
Hi. Using godot alpha I’m getting the following error when attempting to use get_node in _ready:
ERROR: Condition "_instance_bindings != nullptr" is true.
I’m probably making use of _ready incorrectly but I am not sure.
Actually, what happens is that whatever code is inside _ready will be executed when the custom node is added to in the editor, not just when the game is launched. Is that the desired behavior for in example initialize default values for “exported” variables?
What this implies is that errors will be found when the node is added if the node needs some child and there are no find conditionals about them. I added a project example I was creating to report a possible error I found in 3.x that might be happening in 4.0 and I faced this error. Am I doing something wrong here?
Steps to reproduce
- Create a gdextension
- Add the custom node to the scene
- Define virtual _ready override
- Use
get_node
in the _ready method
Minimal reproduction project
git clone --recursive -b _instance_bindings_nullptr https://github.com/Karmavil/minimal.git
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 23 (21 by maintainers)
I can still reproduce this in https://github.com/godotengine/godot/issues/62152 (MRP is there). From what I can see this error is harmless, but there’s probably something going wrong.
I tried running OP’s MRP, but couldn’t get their CMake to work. After converting it to scons, I got other errors.
I can reproduce in https://github.com/godotengine/godot-cpp/tree/master/test though
Reopening so we don’t lose track of this, but it might be a different issue (just producing the same result). We should re-verify with the same MRP and open a new issue in case.