playMaker

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

tcmeric

  • Sr. Member
  • ****
  • Posts: 480
    • View Profile
Remove Items from Playmaker Array
« on: May 21, 2017, 06: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!

krmko

  • Sr. Member
  • ****
  • Posts: 422
    • View Profile
    • Fat Pug Studio
Re: Remove Items from Playmaker Array
« Reply #1 on: May 22, 2017, 12:59:05 AM »
Just wondering, why aren't you using arraymaker?

Make a loop with delete at index 0 until you empty the array.

tcmeric

  • Sr. Member
  • ****
  • Posts: 480
    • View Profile
Re: Remove Items from Playmaker Array
« Reply #2 on: May 22, 2017, 01: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.

krmko

  • Sr. Member
  • ****
  • Posts: 422
    • View Profile
    • Fat Pug Studio
Re: Remove Items from Playmaker Array
« Reply #3 on: May 22, 2017, 02: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 :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12344
  • Official Playmaker Support
    • View Profile
Re: Remove Items from Playmaker Array
« Reply #4 on: May 22, 2017, 11:47:52 PM »
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