Hey there, I implemented next logic in my game(see attached file):
-
I have there scene for RESTART lvl where I remove previous scene and go back to previous scene.
-
I have scene with transition to NEXT lvl which transfers us to next scene and deletes previous scene
-
And also here are 2 GAME scenes where directly actions are happening. In each scene I have var which responsible for counting TIME and ATTEMPTS. So if I’d have success in passing level I’d get this var, write it and make it zero(var=0) .
So… When I enter in first scene all works good, when I restart it - also works good. Var writes and rewrites. But when I go to next level it begins to work only once and after restarting var doesn’t rewrites, see attached file with logs.
There we can see On first screen_log three numbers where 1st is TIMER, 2nd - ATTEMPTS,3d - Sum of them and after them string"it was restart scene".
On second screen I have 3 numbers but they weren’t rewrites and moreover it feels like vars don’t redefine during restart on 2nd game scene. So how could it be?? I can’t find where trouble is. I need TIME var be rewritten every restart. Also I delete previous scenes.
And If I choose level from LEVEL MENU it also works good. Trouble is appearing ONLY on transition to NEXT lvl