How do I fix the global variables in layouts?

0 favourites
  • 3 posts
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • Hi guys, I have a game like when you touch the money sprite the money amount increases by 5. Yet, I have 3 layouts and they all have the same global variables; money, success, and popularity. In layout 1, I touch the money sprite, and the money increases by 5. But when I go to layout 2 if I don't touch the money sprite again the money amount doesn't appear instead ''0'' appears because I set text to ''0''. It still increases and be 10 but it doesn't appear if I don't touch. When I go back to layout 1, it's the same. If I don't touch the money sprite, the money amount doesn't appear even though it increases. I mean they turn into their starting text name when I don't touch upon the sprite. How can I fix this? I hope you understand me:(

  • Consider hosting your c3p project file online and pasting the URL in a post here.

    By the sound of it, you may have an issue with the event sheet that is associated with your various layouts (Property "Event sheet" of the layout).

    Or perhaps you have different event sheets, and don't have an event in your second layout to display the value of your global variable in your text object.

    Global variables are common to the whole project, whatever Event sheet they have been created on.

    You indicate "I have 3 layouts, and they all have the same global variables".

    This should not be possible to have a global variable named "money" defined in three different event sheets. If that is the case, then perhaps you are actually dealing with a local variable.

    Post your project so we can investigate and provide an accurate answer to your issue.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hello, thank you for answering. I fix the problem:)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)