GameKit tutorial

My problem was heavily influenced by the GameKit tutorial : https://www.raywenderlich.com/706-gameplaykit-tutorial-entity-component-system-agents-goals-and-behaviors#c-rate

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 ?

With no replies to this topic I would like to request the post be removed.

I can repost a better structured question, with code.

Kind regards

I figured it out.

Removing the Entity and its Components would have the system behave as expected.

This topic was automatically closed after 166 days. New replies are no longer allowed.