Autoload Scenes properly typed for parser #10524
FoxyFox909
started this conversation in
Engine Core
Replies: 2 comments
-
I think you forgot to discard some files! Here's MRE discarding I cannot reproduce on windows ( v4.3.stable.official.77dcf97d8 ) Warning flag is up If issue is persistent, wonder if adding class_name SomeClassName extends Node
var a : int = 12345
func _ready() -> void:
print("Autoload autoloaded: ", name) |
Beta Was this translation helpful? Give feedback.
0 replies
-
I attempted adding |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using Scene autoloads (picked
.tscn
file for autoload), and you haveunsafe_property_access
warnings turned on, the debugger will be angry with you and tell you that the property is not present on the inferred type "Node".This warning goes away when you make the autoload be a script instead (picked
.gd
file for autoload).This makes it cumbersome to use Autoload scenes if you need to access any of the properties in its the script of its root node (which does work, but triggers warnings).
AutoloadScript
is a.gd
autoload.AutoloadScene
is a.tscn
autoload with the same script asAutoloadScript
set on its root Node.Here is an MRP: autoload-mrp.zip
Beta Was this translation helpful? Give feedback.
All reactions