How do I keep local variables?

Get help using Construct 2

Post » Sat May 14, 2016 1:28 am

Hello! :)
I have a player that have some local variables like "heath" and "coins", and i want him to keep this values between layouts, is this possible?
Ps: Sorry if i said something wrong, it's not my main language.
Image
B
40
S
14
G
2
Posts: 132
Reputation: 3,523

Post » Sat May 14, 2016 1:34 am

Yeah you can make global variables that hold the values and then you can access them through all event sheets...

To make a global variable right click in the event sheet and the option to make on should show up
B
11
S
3
Posts: 2
Reputation: 684

Post » Sat May 14, 2016 4:46 am

You can also just make your player a global object in the properties window - this way he'll keep all the variables when changing layouts.
B
124
S
43
G
41
Posts: 849
Reputation: 28,235

Post » Sat May 14, 2016 4:45 pm

Thanks everyone! I'll try both solutions and see whats the best for my game :)
Image
B
40
S
14
G
2
Posts: 132
Reputation: 3,523


Return to How do I....?

Who is online

Users browsing this forum: ditocruz, mcscooter, RalleRoyal and 28 guests