Transfer variables (scores) between scenes?

Is there a way to transfer variables between scenes?
I’m wanting to create a quiz with a different scene containing unique question.
I found the get/set space property example which shows me how to add the score through variables but i want to be able to transfer a players score from scene to scene.

Is this possible?
Could you somehow have a final scene which contained all the correct and incorrect answers?

Cheers,
Pat

3 Likes

Hi @Patrick_Coleman_GO

I created a sample scene for you

I have used separate properties for storing result on every scene and one property to store total number of correct answers.

I hope that helps

3 Likes

Can you show two scenes, I understand the first scene but and still conufse don what to do on the second scene.

2 Likes

Hi @William_O_Donnell,

the code above is the code from the second scene. On this example variable allAnsw is used as a global property variable and stores the number of correct answers. You can read this value using CoBlock “CoSpace property” or set it using “set CoSpace property”
you can remix the space and see how this is done in this example

2 Likes

I can’t remix the game.

2 Likes

You, probably, have basic account and cannot remix spaces.
If it is not, then please send a screenshot of the project page and the device you are using.

2 Likes

It should work since it worked before with other games

2 Likes

I have shared this space again and double-checked all settings. Please, try again

2 Likes

It works thank you so much :smiley:

2 Likes

Hello. I’d love to take a look at the code for this as well, as I’m stuck on the same issue - I can’t appear to remix it, even with a Premium account. Is this code still available to see/remix?

2 Likes

Yes, the code is still available. To remix the space, press the + icon in the CoSpace preview window.

2 Likes

What is the 2Answ? I am have all the questions in the same scene and I want the second scene to display the score…
How would I go about doing this?

2 Likes

Hi @Brayden_Taylor, try remixing the following:

Hope this helps, let me know if you have any further questions about this.

Geoff @ TechLeap

2 Likes

I still don’t understand how to restart the game and go back to the first scene it contains variety coding can you tell me how to code Transfer variables (scores) between scenes

2 Likes

Use cospaces proprety (behind normal vars when the advanced coblocks are on) that don’t change between scenes (you can use them everywhere in the project).

1 Like

Can you show me an example? Thanks for the reply

2 Likes