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
39
S
14
G
2
Posts: 120
Reputation: 3,454

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
10
S
3
Posts: 2
Reputation: 659

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
122
S
42
G
40
Posts: 846
Reputation: 27,994

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
39
S
14
G
2
Posts: 120
Reputation: 3,454


Return to How do I....?

Who is online

Users browsing this forum: Darth Crusher, marcoscodas and 7 guests