The reason this happens is because the AI tank needs to get a lock on the player tank. If the projectile velocity is too high and/or the player tank is too close, SuggestProjectileVelocity won't be able to find an aim solution and the AI tank can't get a lock on the player. Another contributing factor is that the root of the player tank that the AI aims at is very low to the ground, making it difficult for an aim solution to be found. There are two possible solutions to this:
Have the AI tanks aim some offset above the player Tank's root
or
Rework the aiming architecture and instead of using SuggestProjectileVelocity, just align the
barrel with the vector that gets projected through the player's crosshair. This might get rid of a lot of the other quirks with aiming as well.
Another option would be to look at how IsBarrelMoving() works. The issue is that the AI tank thinks their barrel is moving when the player is too close because this method fails because SuggestProjectileVelocity can't find an aim solution when the player is up too close.
The reason this happens is because the AI tank needs to get a lock on the player tank. If the projectile velocity is too high and/or the player tank is too close, SuggestProjectileVelocity won't be able to find an aim solution and the AI tank can't get a lock on the player. Another contributing factor is that the root of the player tank that the AI aims at is very low to the ground, making it difficult for an aim solution to be found. There are two possible solutions to this:
or
Another option would be to look at how IsBarrelMoving() works. The issue is that the AI tank thinks their barrel is moving when the player is too close because this method fails because SuggestProjectileVelocity can't find an aim solution when the player is up too close.