playMaker

Author Topic: Array list index positions [Solved]  (Read 605 times)

LuminRabbit

  • Full Member
  • ***
  • Posts: 161
  • Lumin Rabbit
Array list index positions [Solved]
« on: November 01, 2020, 01:33:52 PM »
Hello,

In one state I’m adding an item to an array list (at whatever index is next available) and storing the index.

In another state I’m removing the item from that index, which is great but if it gets removed from an index in the middle of the array, the other items after it move down one, changing the index it was located at. So when I remove another item the wrong item gets removed.

Any ideas on how to resolve this so that each item when created keeps its index?

Edit: although a bit unconventional I used Array List Insert and left the Data type and variable set to none (and now it adds a null into that item slot at that index).
« Last Edit: November 01, 2020, 03:22:02 PM by Kodagames »
Have I said how much I love playmaker!!! This is one amazing tool

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Array list index positions [Solved]
« Reply #1 on: November 02, 2020, 06:34:34 AM »
Hi.
to make it 'empty' without removing totally you can use 'Array List Set' and set (for example on a Game Object array) the object empty.