playMaker

Author Topic: GameObject Array - "Array Clear" [SOLVED]  (Read 1284 times)

RocknRoli

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
GameObject Array - "Array Clear" [SOLVED]
« on: January 14, 2018, 03:53:04 PM »
Hello,

Long time reader, first time contributer...

How do i delete all my game objects in an array? With the "Array Clear" action, it generates null objects in my array...

It works with array delete at but then i would have to copy and paste the action 120 times if i want to delete all the game objects  in my fsm.

Thx in advance

« Last Edit: January 17, 2018, 05:22:43 AM by djaydino »

LeDisciple

  • Playmaker Newbie
  • *
  • Posts: 17
    • View Profile
Re: GameObject Array - "Array Clear"
« Reply #1 on: January 14, 2018, 06:12:52 PM »
That's a bit vague because we don't know how your fsm add an array, is it a spawned game object and destroyed sometime in your game with an "Array List Add"? if it so then before destroy the game object add an "Array List Remove" with the owner, you'll get a clean up-to-date array list.

omgitstri

  • Playmaker Newbie
  • *
  • Posts: 46
    • View Profile
    • My Prototypes
Re: GameObject Array - "Array Clear"
« Reply #2 on: January 15, 2018, 10:10:53 AM »
Hello RocknRoli,

You can use the Array List Take Snap Shot before you add to the array, when you want to revert it back to the initial state, use Array List Revert To Snap Shot.

Hope this helps
Tri Nguyen
Game Designer at Nvizzio Creations

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15060
  • Official Playmaker Support
    • View Profile
Re: GameObject Array - "Array Clear"
« Reply #3 on: January 16, 2018, 12:25:34 AM »
Hi,

 I think you are not using ArrayMaker but the built in FsmArray. So the posts about ArrayMaker will not be valid.

 If you want your array to have no entry, use ArrayResize action and resize to 0.

 Did you try that?

 Bye,

 Jean

RocknRoli

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Re: GameObject Array - "Array Clear"
« Reply #4 on: January 17, 2018, 03:45:15 AM »
Jean was right. I use the built in fsm array...

array resize works great.

thank you