Tell me how to correctly implement the logic of NPCs for choosing a target.
I have my npcController and npcModel classes. The scenes in the project are small. The number of NPCs in the scene is 10-15. I have a class – manager, which contains two lists of NPCs (two fractions):
List <NPCController> enemies
List <NPCController> friendly
I implemented a custom task to verify that the NPC sees an enemy target (checking distance, viewing angle and raytrace). Based on the result of the check, I fill out for each NPC a list of enemies that he sees:
List<NPCController> iSeeNPC
How do I use BT to correctly build a goal selection from a list? For example, I want to choose a goal with a minimum level of health. The problem is that I canβt sort out the List of NPCConttoller in BT – of all the actions, I can only work with lists of objects from the unity set (GameObject, Transform etc)
Make separate lists for transform npc, life npc etc. – in my opinion is wrong.
If I will create a new custom task for this and next actions, then I will lose the benefits of BT.
Can I work in BT with my NPCConttoller classes in the same way as with Transform, GameObject, etc. classes?
Or do I need to change my approach to creating logic AI?