Why won't my clone increase the value of my score

Godot Version

4.3

Question

Why does my score variable not go up for child nodes but it still delete them and prints coin collected which are all under the same script. It only works when I put the coin scene in my freemode scene but i want them randomly placed throughout my map as clones every few seconds. Please help
image
image

Well you are increasing the value of a local variable which gets deleted with queue_free(). Wheres your score variable?

I don’t know what you mean. What should it look like. Should I use autoload?

autoload or static variables are the easiest way

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.