Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: RobotGoggles on August 02, 2021, 08:22:00 PM

Title: Array List Remove not working?
Post by: RobotGoggles 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.