Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: blackant on April 28, 2019, 04:09:41 PM

Title: Using the Foreach Array action
Post by: blackant on April 28, 2019, 04:09:41 PM
Hello,

this is the first time i'm using this action "Array For Each",
i understand the princip but it doesn't work like i espect (it doesn't work at all..)


so i have a character, wich if i click on it, is added to an array, after that, if i click anywhere on the ground, the character must go at the position.
so for each character from the array it would repeat the task.

but for now, with only one character selected and in the arraylist, it doesn't do anything...

the only things i'm asking to the FSM is to set the position vector3 and send event to the gameobject. nothing more...

but the state is still stuck this for each step and will never finish.
but it can finish with an array lenght of 0.
Title: Re: Using the Foreach Array action
Post by: Alex Chouls on April 29, 2019, 05:08:31 PM
Does the FSM you're running finish? It needs to use the Finish FSM action to tell the caller that it's finished and to move to the next item in the array.
Title: Re: Using the Foreach Array action
Post by: blackant on April 29, 2019, 06:19:05 PM
i replaced the action by "Get Next" array but i'll check tomorow to understand how it works.

thanks
Title: Re: Using the Foreach Array action
Post by: blackant on April 30, 2019, 01:02:40 PM
it works, but the trap is that it is marked as an Error.
Title: Re: Using the Foreach Array action
Post by: Alex Chouls on April 30, 2019, 07:29:26 PM
I think that error is that you don't have a transition state from the FINISHED event. It looks like you can just delete the FINISHED event if it's not used.

Are you using a Finish FSM action?

Title: Re: Using the Foreach Array action
Post by: blackant on May 01, 2019, 01:25:25 AM
haaa, ok, i didn't know that there was a finish action.
ok i understand  know