Array.Pop strange behavior

Discussion and feedback on Construct 2

Post » Thu Oct 10, 2013 11:22 pm

Hi,

I was playing with the array and poping an item in an array increase the number of element of that array..it is normal ?

I mean once i poped it, it should have removed it not adding element to it. The element is empty.. but it is still added.

But i have a guess which is probably the size of the array that incrementing. Is there a way to avoid this ? even reducing the array size after the pop doesn't work.

Thanks!Rushino2013-10-10 23:23:47
B
16
S
5
G
1
Posts: 190
Reputation: 2,489

Post » Fri Oct 11, 2013 1:31 am

Nevermind, look like its my lack of knowledge in the array object. To have initially zero element you must set..

width: 0
height: 1
depth: 1

if you set all zero everywhere, it won't add anything to the array.. which make sense since there no height or depth. At least you need 1 height and 1 depth to represent a 1D array.
B
16
S
5
G
1
Posts: 190
Reputation: 2,489


Return to Construct 2 General

Who is online

Users browsing this forum: jefftrier, The Mnk, vikuserro and 7 guests