Hi all. I have problem with my enemy. Its this that when they attack me they are collide together. I want to make them to keep their distance.
can you help me to solve this problem?
Hi all. I have problem with my enemy. Its this that when they attack me they are collide together. I want to make them to keep their distance.
can you help me to solve this problem?
It`s a very general question and depends on what kind of AI you are using.
Of course you simply could measure the distance between your enemies by using Vector3.Distance and make them give way when the distance is to low. But you also have to keep track of obstacles, and maybe the characters should not drift too far away from a given path… You also could let your characters make a radar-like raycast all the time, but this might be a performance issue if the amount of enemies is to big…There are several things to consider.
I guess this will be a very complex script soon ![]()