Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | KKIILLOOUU |
Hi,
I would like to understand how parent can call a variable from a child.
the tree is like that
map
>navigation
>some other nodes…
>unit
>mob
If i write in navigation node
var damage = 5
I can call it in mob node like this
health -= get_parent().damage
i would like to call var atak = 5 wich is in unit node,
and doing Something like this ( in navigation node) var damage = $unit.atak
I know that won’t work because the var damage don’t become the var atak from node unit.
I tried to link atak directly to the script on mob but it didn’t work too. And i don’t want it.
thx.
edit : finally if there is way to call variable child to child, i will take it.
i know i need to put onready before var damage = $unit.atak
But it Don’t work too.
KKIILLOOUU | 2020-06-02 02:42