My problem was heavily influenced by the GameKit tutorial : GameplayKit Tutorial: Entity-Component System, Agents, Goals, and Behaviors | raywenderlich.com
Using the two team structure, I have a single AI entity that can move, whilst the other team are static, but in greater number. The code to direct the AI entity to the closest enemy works, but when beaten, it will not move unto the next.
For some reason the calculateAccumulatedFrame() intersects comparison calculation fails in the Melee component. I believe that I have traced the issue back to the Move component as this should be where the decision to move to which entity is taken, but I just can’t see anything wrong with it?
I have added a new boolean property to denote if the entity is “destroyed” and created an array to collect these entities, of which I then pass through the “avoid” parameter in MoveBehaviour. This does work, but for some reason the AI just aimlessly walks around and cannot see the other entities, even though the code seems be able to.
The MoveComponent is a delegate also, and whilst the update statement accurately reflects the existing entities on the scene, perhaps I need to do something with the delegate to get it to recognise their positions ?