playMaker

Author Topic: Array List Remove not working?  (Read 637 times)

RobotGoggles

  • Playmaker Newbie
  • *
  • Posts: 35
Array List Remove not working?
« on: August 02, 2021, 08:22:00 PM »
I'm trying to create a system for organizing enemies in combat using arraymaker and I've run into an issue.

Each unit in the game has a list of targets (named TargetList) and I'm using the Array List Get Closest GameObject action to find the closest enemy. When enemies die, they deactivate, so they aren't removed from the list and still get returned in the Get Closest action, which causes problems. To solve this I added another state with the Array List Remove At action, but as far as I can tell no items are being removed from the list.

Is there something about one of these actions I'm not using properly? Is there a better solution? I'm trying to avoid giving each unit a collision check, since there are a large number of them on screen at any time and physics has been causing issues.
When life hands you insomnia, make video games.