Please help

Discussion and feedback on Construct 2

Post » Fri Jun 30, 2017 2:01 am

How do I create a score that doesn't reset on new layout.

I have tried using global variable but it still reset when going to a new layout
B
3
Posts: 4
Reputation: 187

Post » Fri Jun 30, 2017 7:28 am

Global variables shouldn't reset when going to a new layout. Are you using a "Reset global variables" action with an "on start of layout" event? If so, you will need to save the score to a local or instance variable, or to local storage before resetting the globals. You can then reassign the value back to the global variable after resetting.

If you aren't using reset global variables then you must have an action in your code somewhere that is setting the score back to 0.
Last edited by mekonbekon on Fri Jun 30, 2017 1:40 pm, edited 1 time in total.
B
16
S
7
G
3
Posts: 395
Reputation: 3,693

Post » Fri Jun 30, 2017 12:47 pm

Please provide a .capx or a screenshot of your project/code. That way we could help you more accurately.
B
127
S
33
G
17
Posts: 1,549
Reputation: 20,454

Post » Fri Jun 30, 2017 7:56 pm

I figured it out! Tthank you guys
B
3
Posts: 4
Reputation: 187


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests