Is the type of the node; e.g. Area2D. And while health and run() will work at runtime (thanks dynamic languages!), godot doesn’t know unless given a type (it sees only Area2D).
If you do this:
class_name Player
extends Area2D
var health
func run():
pass
and:
($Player as Player).
The editor will auto complete.
Now it’s working! Thanks!
cgvirus | 2023-04-06 21:21
Hi, it seems like Godot 3 script editor can do it without assigning classes. Do you know what might have changed this behavior in Godot 4?
Thanks to spaceyjase’s answer. it is due to dynamic type scripting.
Although Godot supports static typing and that is more favorable IMHO. I have found a good doc in Godot doc lately. For reference: