Godot Version
4.2
Question
It’s a bit strange that I can’t drop my nodes into gdscript inside the player scene unlike the main scene, I can still drop them. I just want to ask why that happens?
so it’s drag and drop to get the reference/nodepath to the node?
opened 07:32AM - 04 Sep 23 UTC
closed 01:10PM - 06 Sep 23 UTC
bug
topic:gdscript
topic:editor
### Godot version
v4.2.dev3.mono.official [013e8e3af]
### System information
… Godot v4.2.dev3.mono - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3050 Ti Laptop GPU (NVIDIA; 31.0.15.3598) - AMD Ryzen 7 5800H with Radeon Graphics (16 Threads)
### Issue description
When creating and attaching a built-in script to any type of node, trying to drag nodes from the scene-tree results in an error that appears at the bottom-right of the editor, but not in the console window. The error states:
`Can't drop nodes because script 'xxxxxxxx::xxxxxxx' does not inherit Node.`
Even though the script clearly extends Node or any other type.
### Steps to reproduce
1. Create and add any node type to the scene tree.
2. Attach a new script, choose Built-in from the dialog.
3. Save the scene first, as at the time of writing, Godot suffers from a bug that causes it to crash if the scene was not saved first.
4. Try dragging or even ctrl-dragging a node to the script.
5. Observe the error appear at the bottom-right in a yellow-accent pop-up.
6. Nod and confirm that the bug exists.
### Minimal reproduction project
[can't drag nodes into built-in scripts.zip](https://github.com/godotengine/godot/files/12511196/can.t.drag.nodes.into.built-in.scripts.zip)
Loose files in the archive. Extract into their own folder.
from the looks of it, it should have been fixed on stable release, because it’s merged, but i dont see it on Godot changelog at the moment, need to search if it’s alrdy fixed then i can say it’s fixed
hsdsz
February 16, 2024, 5:10pm
5
I got this error too in 4.2 stable version
Does it work if your script doesn’t have any errors?
2 Likes
Same problem, but you are right. You have to correct the error, save the script , then the drag & drop works again !
Removing console errors worked for me, rather annoying that it can’t automatically create the link if there’s errors or give a more detailed error