Hi CM! Big fan, recent newcomer to your tutorials and I absolutely love the way you code and how you teach clean code.
I’ve followed every step, double and triple checked the logic but it seems as if the enemy units do not physically move to the grid position where they can fire at the friendly units.
I’ve tried adding an action value to the spinaction (5) to see if the moveaction is just somehow returning 0 instead of 10 or 20 (based on the targetCountAtGridPosition * 10 logic), and the enemies do not spin.
Checking the targetCountAtGridPosition with a debug, it seems like the logic can determine where the best gridposition is, and is returning the correct actionvalues of 10 or 20. This logic is firing off so the enemies will never take the lower actionvalue Spin action, which is working correctly.
However, even when the enemy units receive the best gridposition to move to, they aren’t actually moving to shoot at the friendly units, and then it just ends their turn as they have no valid action to take.
Any help on this will be appreciated! Thanks