You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an autoload singleton with some children and its script has some onready vars that reference them so that I can do "singleton.child". The problem is that when I write methods in a child script, even if the onready vars in the singleton are statically typed, if I access them from outside the singleton using its global variable, autocomplete won't suggest them, but will only suggest the child's base class methods. Though, if inside the singleton I access those same onready variables without passing through the singleton global variable, autocomplete works as expected.
Steps to reproduce
Create a scene with Node as a parent
Add a Node as a child of the previous Node
Attach a script to the parent Node and declare an onready var that references its child like so @onready var child := $childNode as ChildNodeType
Attach a script to the child Node and declare a random function like so func random_function(): pass
Set the whole scene as an autoload singleton with the global variable turned on
Create another scene to set as main scene
Attach a script to the parent node of that scene and in its _ready function try to access the random_function we declared before passing through the singleton global variable
You will now notice how singleton.child.random_function() doesn't get autocompleted, but works anyway
Godot version
v4.0.stable.official [92bee43]
System information
Windows 11
Issue description
I have an autoload singleton with some children and its script has some onready vars that reference them so that I can do "singleton.child". The problem is that when I write methods in a child script, even if the onready vars in the singleton are statically typed, if I access them from outside the singleton using its global variable, autocomplete won't suggest them, but will only suggest the child's base class methods. Though, if inside the singleton I access those same onready variables without passing through the singleton global variable, autocomplete works as expected.
Steps to reproduce
@onready var child := $childNode as ChildNodeType
func random_function(): pass
singleton.child.random_function()
doesn't get autocompleted, but works anywayMinimal reproduction project
SingletonAutocompleteTest.zip
The text was updated successfully, but these errors were encountered: