Doing variable check across scenes

HI all - I have looked up the help resources here and used the CoSpace property block too but I am not sure where the mistake is. What I want is for users to choose a runner in scene 1. Then, in Scene 2, after the race is complete if that runner wins - then a message is displayed. Can someone verify where my error is?

CoSpace link >> CoSpaces Edu :: Global vars

Hi @Shashi_Krishna,

Three problems;
One global variables cannot hold an object directly, so the name of the object must be used to find the reference of it in the second scene.

Two, you were checking if the name of item 0 in position list (which is just a reference to your text object) is equal to your global variable of your runner, which will never result to true.

And three because of the run seperately block the check to see who has won goes off immediatly before the race has even finished.

I’ve restructured the code here a little and turned the references to names. Hope this helps, Good luck!

3 Likes

Thank you for your help with this! I see the mistakes I was making with how the scenes are recognising the runner object.

Thanks again!

1 Like