playMaker

Author Topic: Array List Contains action not finding an array item [SOLVED]  (Read 1047 times)

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Hello, i've got a strange problem. I've got a weapon upgrade system, here's a shot of it



It's simple, weapons on ship are stored in an array as game objects. When you pick up a weapon, it is checked if any of the levels of the same type of weapon exist in the array. If they do, it is upgraded to the next level. If not, empty weapon slot is filled with the pickup weapon, or if all slots are taken, active weapon is replaced with the pickup.

As you see on the following picture, the weapon type that it is checked for is there, but the state does not go to upgrade, but keeps checking for the next levels, like the variable does not match.



I thought there could be a problem because it is a clone (spawned from pool), but it works perfectly fine when it checks for empty weapon object at the end of the compare loop, which is also a cloned item and the names don't match.



Any ideas?

Btw, here's the shot of the populated array:



Only thing that seems quirky to me is that the array is populated with CLONE 1, and in the array contains action it says CLONE 2.

Things work when i use game object compare, but i don't want it to work that way.

Edit: All good, stupid mistake.
« Last Edit: April 22, 2017, 12:35:18 PM by krmko »
Available for Playmaker work