Hi, I am quite new in Godot and I’m looking for methods of exporting my variables.
Currently I’m working at quiz. The problem is I have separate scenes for each question and I don’t know how to add value to main script int (main script is attached to non-question scene) If I answer correctly.
Sorry i didnt mention that this is part of bigger project. And i dont have acces to it. My collegue will implement my part to this “bigger project”. So i suppose i cant use autoload. Let me know If I am wrong.
use emit signal.
connect the signal when you instantiate + add_child the question scene
then when you need to add score to main scene, just emit the signal
is this main script just a script that’s not attached to any node or there’s? if so then you can add the node attached to a group and just get the main script node by group name
if your main script node and question is already existed since the beginning of time (added via editor), then you can just reference the node by nodepath
Thanks it works but i have feeling that this is not optimal becasuse after clicking answer i have to hide one question and show another. I would appreciate better solution or just saying this is ok.