godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.02k stars 19.91k forks source link

Grab Node, CTRL drop node into script isn't casting an @onready variable #88387

Open scotmcp opened 6 months ago

scotmcp commented 6 months ago

Tested versions

v4.2.1.stable.mono.flathub [b09f793f5]

System information

Godot v4.2.1.stable.mono (b09f793f5) - Freedesktop SDK 23.08 (Flatpak runtime) - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4060 () - AMD Ryzen 7 5700X 8-Core Processor (16 Threads)

Issue description

When grabbing a node and CTRL-dropping into a script, it dropped just the reference to the node. It is not casting the @onready variable. This seems to work find in windows, but is not working in linuxmint 21.3.

image

Steps to reproduce

Grab a node and drop into attached script.

Minimal reproduction project (MRP)

Test Project for Bug.tar.gz

kleonc commented 6 months ago

@scotmcp I don't understand what issue is being reported in here, please elaborate.

When grabbing a node and dropping into a script, it dropped just the reference to the node.

That's how it works, yes. What would you expect to happen instead? Preferably please provide a specific example for the current behavior vs expected behavior.

It is not casting the @onready variable.

@onready variable is created only when dropping a node with Control key pressed. And it would be statically typed (casted) if text_editor/completion/add_type_hints editor setting is enabled.

This seems to work find in windows, but is not working in linuxmint 21.3.

I'd guess you have text_editor/completion/add_type_hints editor setting disabled on linux.

scotmcp commented 6 months ago

@kleonc This setting doesn't have any impact on this. At your suggestion, I tested this in both windows and linux to see if it would have an affect on the reported bug. As expected, this setting simply affects whether the variable type is identified...not whether a variable is cast or not.

The bug as described remains.

kleonc commented 6 months ago

@scotmcp Sorry but your explanation is still a little unclear to me. So please confirm if I understood it right:

Did I get it right?

scotmcp commented 6 months ago

Did I get it right?

Yes you got it right

ajreckof commented 6 months ago

Can't reproduce on macOS 13.3.0 - Vulkan (Forward+) - integrated Apple M1 Pro - Apple M1 Pro (8 Threads) so this is a linux only bug

AshishHirapara commented 2 months ago

@kleonc This setting doesn't have any impact on this. At your suggestion, I tested this in both windows and linux to see if it would have an affect on the reported bug. As expected, this setting simply affects whether the variable type is identified...not whether a variable is cast or not.

The bug as described remains.

@scotmcp The same issue happened to me on Ubuntu 22. But when I pressed the second (right side) CTRL, that drag and drop worked. Try doing that

millermatt commented 1 month ago

I can confirm that the right Ctrl+drop works, and left does not.

Godot v4.2.2.stable - Ubuntu 22.04.4 LTS 22.04 - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1650 Ti with Max-Q Design () - Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz (12 Threads)