Array Push doesn't add value?

Discussion and feedback on Construct 2

Post » Fri Jul 27, 2012 6:29 pm

Hey,
I have a strange problem, which I hope someone can help me with.
I have 7 toggle buttons, each with a boolean instance variable called "isEnabled". When you press a "Submit" button, a global array which I have is reset to size (0,0,0. Then, I check each toggle button if its isEnabled value is true. If it is, then it does the action: Push Front 2 (or something else) on X axis (its a 1D array). When I cycle through the array, the array is the size of the amount of enabled toggle buttons, which is what I was trying to achieve, but everything in the array is 0. So the array is being pushed and cells are being added, but their value is 0 instead of the specified number.
Sorry if this is confusing, its a bit hard to explain.
Thanks in advance!
B
40
S
8
G
6
Posts: 61
Reputation: 5,951

Post » Fri Jul 27, 2012 7:10 pm

Set the array size to (0,1,1). The height or depth can't be zero.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Fri Jul 27, 2012 7:12 pm

I thought I tried that... obviously not - thanks! It worked!
B
40
S
8
G
6
Posts: 61
Reputation: 5,951


Return to Construct 2 General

Who is online

Users browsing this forum: Pehesse and 15 guests