I’ve been working on getting a believable AI environment where animals move to different locations based on whether the area has been utilized recently and how much health each location has.
I’ve created 2 separate actors, grazing spot and water which I want my AI (in this case its a zebra) to move to. I have multiple grazing spots and water spots located around world each with health set to an integer. Health is removed once from grazing spots and water spots when a zebra comes into contact with their collision spheres. To avoid zebras continuously going back and forth to the same graze spot, I want to have a boolean value (hasbeengrazed) for the graze spot which turns on when a zebra hits the collision sphere, which will then be turned back on after a certain amount of time.
The order is
- Zebra moves to closest graze spot with boolean set to off
- Zebra moves to water spot
- Zebra moves to closest graze spot with boolean set to on
I have already setup the graze and water spots, but am struggling to get the zebra to look for all graze spots with boolean set to off and then find the closest one. Currently I am using an EQS but I don’t think it is the most effective way to do it.
Any help on this would be really helpful