请问:怎样在GDscript里读取或修改GameObject自带的变量?How do I read or modify the variables that come with GameObject in GDscript?

我的“GameObject”里有一个子节点“Node2D”,

我想要在“Node2D”上增加一个GDscript,

让“GameObject”自带的变量“hp”=“max_hp”的时候,

“Node2D”的可见性 = False;

“GameObject”自带的变量“hp”<“max_hp”的时候,

“Node2D”的可见性 = True;

请问我应该怎么写代码?

I have a child node “Node2D” in my “GameObject”,

I want to add a GDscript to “Node2D”,

When the variable “hp” = “max_hp” that comes with “GameObject”,

Visibility of “Node2D” = False;

When the variables “hp” that come with “GameObject” < “max_hp”,

Visibility of “Node2D” = True;

How should I write code?

参考【深入AGMaker】脚本片段-打印特定名字的变量和开关 - ACTION GAME MAKER / General/一般 - RPG MAKER GUILD - https://guild.rpgmakerofficial.com/