playMaker

Author Topic: Remove Items from Playmaker Array  (Read 3150 times)

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Remove Items from Playmaker Array
« on: May 21, 2017, 09:10:20 AM »
I am trying to remove all items from a playmaker array (not arraymaker's array).

The action "array clear", just changes all my gameobject to null in the array (which is not really removed).

The action "array delete at", only removes on item based on index number.

How can I clear/remove all the items from the array, so its count is once again 0?

Thanks!

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Remove Items from Playmaker Array
« Reply #1 on: May 22, 2017, 03:59:05 AM »
Just wondering, why aren't you using arraymaker?

Make a loop with delete at index 0 until you empty the array.
Available for Playmaker work

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Remove Items from Playmaker Array
« Reply #2 on: May 22, 2017, 04:41:46 AM »
Why use arraymaker when playmaker arrays has native support? So far this is the only function I have needed that wasent in the native arrays.

Also when playmaker moves to support Unity 2017, will arraymaker as well? My attempt is to use as much core as possible.

Thanks for the tip, ill try that.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Remove Items from Playmaker Array
« Reply #3 on: May 22, 2017, 05:26:50 AM »
I'm using the same solution, it works, but if you have a lot of array items it may take some time.

Quote
Also when playmaker moves to support Unity 2017, will arraymaker as well?

You've got the point there, but you usually shouldn't be swithing versions during development anyway :)
Available for Playmaker work

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Remove Items from Playmaker Array
« Reply #4 on: May 23, 2017, 02:47:52 AM »
Hi,

 ArrayMaker is going nowhere, and will be supporting Unity 2017 :)

 Native array within PlayMaker is of course better to use, but ArrayMaker brings a lot more on the table, namely hashtables. Also I still find arrayMaker easier to use when I need to setup content at edit time, until the native array lenght can be set when fsm array variable shows in the inspector, I am still using ArrayMaker, also with arrayMaker you can technically set different values within the array, it's not forced to one type. it is forces in the inspector but at runtime you are free and that's quite powerful.



 Bye,

 Jean