playMaker

Author Topic: Array of items with a tag  (Read 824 times)

hipoh

  • Playmaker Newbie
  • *
  • Posts: 8
Array of items with a tag
« on: March 21, 2020, 06:16:16 PM »
Hi

Using just the FSM and GUI how do i iterate through a lit of gameobjects witht he structure Parent/5children/4children and create two arrays.

The first array should be all gameobjects with the tag "platform"
The second array should be all gameobject parents with the the tag "4_platforms".


I want to be able to animate the parents to move sets of four platforms around as groups but also split the four platforms into sub platforms and animate then independently.

I do not want to write code ;-) although the code example after knwoing how to do it with the FSM would be great....


many thanks

PAul.
« Last Edit: March 21, 2020, 06:20:52 PM by hipoh »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Array of items with a tag
« Reply #1 on: March 22, 2020, 06:16:55 AM »
Hi.
Use 'Get Next Child' and store in variable.
Set loop Event Transition to next state And Finished Event for When all child's are Checked (ending the loop)

Then on the next state use 'Game Object Compare Tag' or 'Game Object Tag Switch'

then on the next states use 'Array Add'

Then Transition back to the state with the 'Get Next Child'