So, I've had some success... followed by, you guessed it, more failure.
I've got my Game Manager set up as described in a tutorial I found:
This all works fine, I've set it up to store 6 variables; 2 floats, 3 Ints and a Bool for 'docking'
I did a little test, and let the Mothership be attacked by aliens for a bit, reducing it's health to 12, and then I docked to see if the Health carried through, and it does.
You can see here the, Game Manager in the Mothership scene:
And the variables carried through...
When the game starts, the savedDocked bool is set to False, and when you dock it is set to True in the Game Manager:
All makes sense to me, I think.
The problem is, when I launch from the Mothership and go back to the main gameplay scene, the Game Manager has been duplicated. I don't understand why this is happening...
The original Game Manager still has the correct values (12 for Mothership health and Bool set to True) and the new duplicated one has everything set to the start values.
I used a Bool, so that when you re-launch from the Mothership, it can tell if you're starting the scene from New or you've just launched from Mothership.
I did a few docking/re-launch one after the other, and it's adding a new Game Manager every time I re-launch from the Mothership. I'm stumped.
What have I done that's causing the Game Manager to be duplicated? I thought if it had the Don't Destroy on Load action, then it will move from scene to scene.
Any help would, as ever, be greatly appreciated.
Many thanks.
J.