Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: HyperExc on June 02, 2015, 10:03:57 AM
-
So, I've noticed that when you use the actions Array List Remove, and Array List Remove At, it basically destroys the index with it's data assigned to it and renames the other indexes. This is not the way it should work. It's illogical.
Even though I've started working with Arrays recently it seems pretty straightforward. The action should remove the data from the index, but the index should remain empty, or atleast if it destroys the index it should not rename the other indexes, as this messes up the whole structure of the array.
Am I missing something here? I really need it to work the way described above. Or is there another way that this can be achieved? Thank you.
-
The index orders the data by number. When you add data into an array it adds it to a new index number so if you remove data it would reset the order of the array.
What you are looking for I believe is Array List Set. This will let you set something to -null-
-
Hi,
Indeed, you need to look at array like a a stack of cards for example, if you remove the third card, the cards above will move one index down ( the fourth card becomes now the third card).
Also, this action use the built it function in .net, you can look at the doc to get a better idea:
https://msdn.microsoft.com/en-us/library/system.collections.arraylist.removeat(v=vs.110).aspx
Bye,
Jean
-
Thank you both!
I understand now. Also I've managed to make it work by simply adding an empty game object to the index right after I remove it's previous content so that it would keep the array order intact.