Variables for a layer or a group

Discussion and feedback on Construct 2

Post » Wed May 29, 2013 10:32 am

Hi,

I'd like to make a suggestion or maybe there is even already a solution for my problem.
Since I'm working on a huge project I use a lot of global variables. I try to use as many local variables as possible, but I just need most of them in different events.
It would be just awesome if there is a possibility to define instance variables for Layers or local variables for Groups.Nimmermehr72013-05-29 10:34:58
B
5
Posts: 13
Reputation: 849

Post » Wed May 29, 2013 10:56 am

Putting a Local Variable inside a group at the very top will make that variable work throughout that group :P
B
51
S
20
G
10
Posts: 571
Reputation: 9,819

Post » Wed May 29, 2013 12:50 pm

Hm when I try this it always stucks to the first event of the group.
B
5
Posts: 13
Reputation: 849

Post » Wed May 29, 2013 1:30 pm

Illustration of @Jase00's solution :
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
278
S
104
G
86
Posts: 7,313
Reputation: 84,306

Post » Wed May 29, 2013 1:47 pm

Thanks for your efforts but it's not working properly for me :(
Indeed I can access the variable in the whole group but it resets every time I call an event of the group.
B
5
Posts: 13
Reputation: 849

Post » Wed May 29, 2013 1:51 pm

Then check the Static checkbox in the variable. Manual article
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
278
S
104
G
86
Posts: 7,313
Reputation: 84,306

Post » Wed May 29, 2013 1:59 pm

Now it's working! Perfect, thanks a lot!
B
5
Posts: 13
Reputation: 849


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests