[Solved] Setting text input to Global Variable

Hi everyone.

I have included a screenshot of my basic username/email input field to create a document for each player which is linked in another scene to call them back as high scores in a leaderboard.

My problem, is how do I set the “User.name” and “User.email” variables to global variables so that they can be called on in other scenes? I also want to be able to save them to storage so that every time the player enters the game, their user name and email is read from storage and displayed on whatever scenes I choose.

Linking all of this through Firestore has proven to be quite difficult, so I am trying to work on a simple fix.

If just need to set this scene up so that when a player inputs a User Name and Email on this screen, when the button is pressed to create a document in the Firestore collection, global variables are also created for both User Name and Email.

From there I can manage in saving the global variables to storage and calling them in other scenes.

Any help would be greatly appreciated.

Simply use the global variable action when you need it (and scene variable action on the other way around).

1 Like

Thank you. I managed to figure it out when I realized that I had already done it when I changed User.score to GlobalVariableString(HighScore). I just made new global variables for User.name and User.email and set the Global Variables for these to the scene variables here.

Worked a charm.

1 Like