playMaker

Author Topic: Array Add misses last object  (Read 1025 times)

LNMRae

  • Playmaker Newbie
  • *
  • Posts: 2
Array Add misses last object
« on: May 27, 2018, 10:39:32 PM »
So, I'm having an odd problem that I'm not sure if it's a case of not knowing what I'm doing or if it's a bug.

I have four GameObjects in a scene and a Global GameObject Array. Each object has a Get Owner and Array Add action.

Add Array only ever correctly adds 3 of the GameObjects to the list.

If I add another object with the same set up to the scene, totaling in 5 GameObjects with Array Add, the Array will then end up with 4 GameObjects. No matter what, it always fails to add one GameObject.

Oddly enough, the Array itself does show the correct Size, but the final Element in the list always ends up with 'None.'

Any ideas what's going on?

Athin

  • Full Member
  • ***
  • Posts: 163
Re: Array Add misses last object
« Reply #1 on: May 28, 2018, 08:08:24 AM »
If you get the Array Maker actions, you can have an Empty Game Object with an array list with a FSM to grab all objects with XXX Tag.  It will help manage your array as well since each object won't need to have to add itself.

Wouldn't hurt to have that Array Maker too if you plan on working with alot of arrays.