playMaker

Author Topic: Array Delete At - Question  (Read 1148 times)

san

  • Junior Playmaker
  • **
  • Posts: 93
Array Delete At - Question
« on: August 05, 2020, 03:59:53 AM »
Hi, is it possible to deactivating objects from Top to bottom (if i have 10 objects)?
I am doing bullet system and using array to deactivating with pooler destroy stored and having this issue with (Array Delete at) is deleting only previous or last item depend on index number. I know i can use pooler destroy with wait time on bullet but still the data in Array Add is not clearing the game object. To clear it i need (Array Delete at) that index is deleting base on specific index number. not from top to bottom...

I just want to deactivate object top to bottom. Forget about wait time > then delete. I just want Array to deactivate object top bottom.

Any advice?
« Last Edit: August 05, 2020, 04:02:17 AM by san »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Array Delete At - Question
« Reply #1 on: August 05, 2020, 11:05:10 AM »
Hi.
You can use array Get Next to loop thru each object and do with it what you have to do.
Then if you want to clear the list, you can clear the list by resizing to 0.

OR

use 'Array Get' and get index 0, then do what you have to do, then do Array Delete At.
But before the Array get you would need to check the Length of the array to know if it has something in it.

Then loop back (and check Length of the array again).

san

  • Junior Playmaker
  • **
  • Posts: 93
Re: Array Delete At - Question
« Reply #2 on: August 05, 2020, 03:34:13 PM »
Hi djaydino, Thanks ~!

Second option is exactly what i have now. I am getting these Null cuz i setup Array to GameObjects. But i want to clear them from index 0 to 5.

san

  • Junior Playmaker
  • **
  • Posts: 93
Re: Array Delete At - Question
« Reply #3 on: August 05, 2020, 04:23:44 PM »
I am not sure if this is the correct way to do it.
I feed Array delete at into my bullet holes with pooler destroy stored. So if 5 mins up then it's deactivate and delete array null in pool system.

it is working but not exactly what i want.

I do have Array length doing int compare, if more then 10 then doing Array get with Array delete at. But the issue is when Array is added into pool list, the object null are staying there... so that where i want to start deleting Array top to bottom. but the issue is Array Delete at index is doing specific number. not top to bottom.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Array Delete At - Question
« Reply #4 on: August 05, 2020, 04:32:32 PM »
Hi.
Sorry i thought it would remove the array from the list, but it only removes the value.

Most of the time i use Array Maker.

Array maker is more flexible than the build in arrays.
With 'Array Maker Remove At' it removes the array from the list, not only the value.

Here is a tutorial for Array Maker :


san

  • Junior Playmaker
  • **
  • Posts: 93
Re: Array Delete At - Question
« Reply #5 on: August 05, 2020, 04:47:25 PM »
Thanks