-
-
Notifications
You must be signed in to change notification settings - Fork 21k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automplete breaks when using @onready paired with get_node() #73164
Comments
This is still an issue in rc4. It might seem like a tiny problem, but it's very confusing for GDScript beginners. It's even referenced in the very video that motivated me to switch from Unity to Godot: https://youtu.be/YVjT0OeE4P0?list=PLRTDZBJAg1Np16EGdovtdqAbYd1eh8BN2&t=668 |
While it is a "tiny" problem, it is still quite frustrating, especially when you work in a team, and you make an effort of documenting your neatly typed API, and you end up with none of its benefits. As of now, the workaround with the cast still works with the walrus operator (no need to specify the type twice) @onready var wheel1 := $Wheel as SimpleRotate Maybe this is a hint towards the origin of the bug |
Maybe we can close this and discuss it in this issue |
I have the same issue, but unique names ('%') don't solve the problem in my case: My version: v4.1.1.stable.arch_linux |
Godot version
4.0 rc1
System information
Windows 11, GTX 1080Ti, Vulkan
Issue description
Automplete can't find any variables and methods on custom classes when the nodes are loaded with
@onready
:simple_rotate.gd:
machine.gd:
If I add another cast like below, autocomplete does work:
machine.gd:
To make things even weirder, it does work if I make Wheel into a unique name and access it using %:
machine.gd:
Steps to reproduce
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: