How to prevent multiple AI from trying to walk through a door and getting stuck?
I have a zombie wave spawner and it works fine but when a lot of zombies spawn two or more will start to get stuck as the try to go through the same door or converge on the same nav point link. What could I do to avoid this without having to drastically change my levels? Thanks!
asked Apr 08 '17 at 12:20 AM in Blueprint Scripting
This @vanlacke solution with volume is good and you will use it too for sure, but firstly you should check you basic AI setup.
You can check you path (is blocked or not) in many ways. For example: https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/AI/Navigation/UNavigationSystem/TestPathSync/index.html
with decorators DoesPathExists: https://docs.unrealengine.com/latest/INT/Engine/AI/BehaviorTrees/NodeReference/Decorators/#doespathexist
If not, you can tell you ai what to do - like nothing, find random location, back to start, back ... units etc. I think it will be key.
This in not whole solution, because this is not that easy. You should look for tutorial on youtube or elsewhere, but my tips can help on start I hope.
Here is something more in project settings, I forgot it now :P Check Engine - Crowd Manager in project settings, this is very important too (if you are using Crowd, what can help a lot with many ai).
Don't forget also to take a look on https://docs.unrealengine.com/latest/INT/Engine/AI/EnvironmentQuerySystem/UserGuide/
You could have a volume that adds each zombie to an array as it enters. Then, you could tell each zombie individually to go through the door, and once the zombie passes the threshold or exits the volume, remove him from the array and tell the next zombie to go.
Follow this question
Once you sign in you will be able to subscribe for any updates here