(The context might be a little strange because I'm using a translator. If you don't understand what I'm saying, ask me right away.)
I'm going to make a single survival FPS game with Unity.
What I want is a followers in the form of L4D.
It's a very simple AI that follows the player and attacks when it finds an enemy.
There's no problem following the player, but I don't know how to script an attack.
1.Target the first found, that is, the nearest enemy.
2.If a targeted enemy dies, find the nearest enemy again.
3.If an enemy reaches (a certain distance) or is attacked in that state, it will replace the target with an enemy that has reached it immediately, even if it has not been targeted.
4.If you fall more than a certain distance from the player during a battle, ignore the enemy and head for the player.
I think this is the function of the battle.
The concern is how to measure the distance from the enemy and how to aim and shoot at the enemy.
I don't know how to implement AI's hit rate.
I don't know how to deal with this because simply setting the gunpoint direction to the enemy will get the gun's reaction perfectly.
The first thing that came to mind was the Burst.
I think slowing down the attack will avoid a mishap that will kill all of my colleagues, but it will make them seem too useless.
The second is to set the time for the enemy to face the gun.
Instead of keeping the order to aim at the enemy, it's a method of giving it over and over again every half a second.
If you shoot, it'll be shaken by the reaction, and I thought maybe we could make Am face the enemy again in half a second. Of course, half a second is an example. It can be 0.1 second or 1 second.
If you know the answer or any place to refer to, please let me know.
I'm going to make a single survival FPS game with Unity.
What I want is a followers in the form of L4D.
It's a very simple AI that follows the player and attacks when it finds an enemy.
There's no problem following the player, but I don't know how to script an attack.
1.Target the first found, that is, the nearest enemy.
2.If a targeted enemy dies, find the nearest enemy again.
3.If an enemy reaches (a certain distance) or is attacked in that state, it will replace the target with an enemy that has reached it immediately, even if it has not been targeted.
4.If you fall more than a certain distance from the player during a battle, ignore the enemy and head for the player.
I think this is the function of the battle.
The concern is how to measure the distance from the enemy and how to aim and shoot at the enemy.
I don't know how to implement AI's hit rate.
I don't know how to deal with this because simply setting the gunpoint direction to the enemy will get the gun's reaction perfectly.
The first thing that came to mind was the Burst.
I think slowing down the attack will avoid a mishap that will kill all of my colleagues, but it will make them seem too useless.
The second is to set the time for the enemy to face the gun.
Instead of keeping the order to aim at the enemy, it's a method of giving it over and over again every half a second.
If you shoot, it'll be shaken by the reaction, and I thought maybe we could make Am face the enemy again in half a second. Of course, half a second is an example. It can be 0.1 second or 1 second.
If you know the answer or any place to refer to, please let me know.