Save keyboard input for different scene

zcjtetrzcjtetr Member, PRO Posts: 1


I'm trying to make a feature where a user types some text and is then later shown this text in a different scene. I'm using 'when touch is pressed' - save attribute game.text for the input and then load attribute - display text, and this works fine, but only in the same scene as the input. When i try to move the display to a different scene, it stops working. Does anyone know what the problem may be? Thanks!


  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,927

    You need to use a global variable (aka game attribute) for your text. It sounds like you are doing that with game.text so it should work. While testing, there is no need to save and load the attribute. Simply changing the value of game.text and changing the scene will retain the new value. I suspect that your Keyboard Input behavior is not set up correctly. Post a screenshot of your rules. And then double-check that you aren't accidentally changing the value of game.text somewhere else in your rules.

    For a really simple troubleshooting measure, create two new blank scenes. Place the keyboard input actor on one scene with a change scene behavior included and a new actor (NO rules except display text game.text) on the other scene. Test to make sure you can input something and have it display correctly on both scenes.

    When you try that measure, what happens? Does it work?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.