Array Push doesn't add value?

  • 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!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Set the array size to (0,1,1). The height or depth can't be zero.

  • I thought I tried that... obviously not - thanks! It worked!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)