Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | scopericrit |
Hello, I’m new to this, so sorry if I’m wrong at something
I have created a checkpoint and coins in a platformer game, the checkpoint change the spawnpoint’s(an autoload) position to the checkpoint’s, it all working fine, the problem is the coins. The coins resets whenever the player died even if it collected before the checkpoint is activated.
I planning to make a variable iscollected for the coins, if is true then the coin visible is false, not queue free. The coin is in group “coins”. I made an array variable in the spawnpoint. In the script I use get group node name (“coins”). My plan is to assign the array into the variables from the group so that I can checked if its true or not when the player died, if its true, then it will queue free, the problem is I don’t know how to do that.
If I did array = get group node name (“coins”)
then the array have all the name of the nodes, not the variable of the nodes.
If I make a check function return if the variable is true for the coins and did this instead:
for member in get group node name(“coins”):
array = member.check()
the array has only one variable stored, changing in fact.
I just need to assign the array variable to the all node’s bool variables with get group or other method. I am sorry that I do not add the code pic or that I didn’t explain enough to be understandable.