Hi y’all, so I’m having an issue with using arrays although I think I’m doing this right unless I’m missing something. So whats supposed to be happening is a button is clicked, then using the array in the screenshot the item 0 is found (on game launch all the items in this array start at 0 aswell), so it’ll more or less be the first index in the array, and once found it replaces that item with the given number at that index ie:1 or 2. But for some reason when clicking the button that makes the first index 1, then clicking the button thats supposed to make the 2nd index 2, it ends up swapping out the first index with 2 instead (although it should be swapping out the second index with 2 since its the next item in the array with 0) as seen in the screenshot. So my question is am I just going about this wrong or am I missing something? Thx for any feedback.
Try clicking ‘size to fit’.
Hi Ripper,
I took a look at this, and found myself banging my head against keyboard trying to get this to work as expected.
I had luck with just setting the index directly on the node.
If you hover over the ArrayGet(a copy) node it does mention that changes won’t be propagated back, but they are, just to element 0… using (get ref) did not help… I think there’s something fundamental about arrays that I’m also missing here…
Your use of ‘Find 0’ is questionable. the first button will always be clicked before the second?
I think what you might mean is
Your setup
Finds the first zero, gets the index, gets the value in the array at that index ( which is zero ), and uses that as the index, and sets it to 1. So you end up with a 1 in the 0 slot, not a 1 where you found the zero…
Sorry for the long wait was at work, but yes that was the fix lol, idk how i always over complicate things.
Also, it probly won’t always be clicked first, but in case it is since there’l be more then just those two it’d be more helpful to line them up since I’ll be using the items as image sizes kind of like Nier: Automata’s chip building (idk what its called) system.