Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: RocknRoli on January 14, 2018, 05:53:04 PM

Title: GameObject Array - "Array Clear" [SOLVED]
Post by: RocknRoli on January 14, 2018, 05: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

Title: Re: GameObject Array - "Array Clear"
Post by: LeDisciple on January 14, 2018, 08: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.
Title: Re: GameObject Array - "Array Clear"
Post by: omgitstri on January 15, 2018, 12:10:53 PM
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
Title: Re: GameObject Array - "Array Clear"
Post by: jeanfabre on January 16, 2018, 02: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
Title: Re: GameObject Array - "Array Clear"
Post by: RocknRoli on January 17, 2018, 05:45:15 AM
Jean was right. I use the built in fsm array...

array resize works great.

thank you