A projectile will lose it's velocity and slowly fall towards the ground based on the gravity. In the case of bullets, this is the concept of bullet drop. Let's test this really quickly in our tutorial scene. Take our cube object and position it to 0,0,500. Then go to our main camera, and set it's field-of-view to 1. This way, we will be zoomed at the cube positioned at 0,0,500. Now play the game and fire, you will realize the bullet drops so much that we are not hitting anywhere close to our center of aim.
Center of aim versus the hit position.
So, we need to aim higher to compensate for the bullet drop. Most modern sniper scopes have the concept of zeroing. They set a specific zero distance, which makes the scope show the target with an angle downwards, causing the shooter to slightly move the weapon with an upwards angle. Thus, the trajectory of the bullet will be such that the bullet will land exactly where we are aiming at, at the zero distance.
Image from: https://riflescopescenter.com/losing-zero/
The same concept is implemented in RSB. Remember we had list of available zero distances in SniperAndBallisticsSystem instance? When the game starts, the current zero distance will be set to 0, indicating no zeroing. But we can change this dynamically by script. Let's upon up our Tutorial.cs and write two blocks to check input for changing the zero distance.
We can use the CycleZeroDistanceUp and CycleZeroDistanceDown methods in SniperAndBallisticsSystem.cs to do this. So let's incorporate them to our if blocks, then also debug the CurrentZeroDistance in SniperAndBallisticsSystem.cs instance. So our whole script should look like this:
Now if you play the game, and cycle the zero distance up to 500 (you can see from the debug console), then fire, you will see that we hit the target exactly at the center.
Target at 500 meters hit at the center with the zero distance of 500 meters.
So basically, you can set your available zero distances in SniperAndBallisticsSystem instance, then cycle them using the two public methods provided during runtime. If you are aiming at a target exactly at your current zero distance, you will not see any bullet drop, if you are aiming a target at a further distance, the bullet will still drop below your aim center. If you are aiming to the target at a closer distance then the current zero distance, the bullet will hit above your aim center.
It is recommended to have 500 meters as the maximum zero distance in the list. Technically, the system can calculate any zero distance up to 2000 meters (limited for performance reasons), but it is not realistic to expect accurate results above 500 meters. A powerful cartridge, such as .388 Magnum or 50 BMG will still result in accurate zeroing around distances such as 1000 meters, but most scopes do not have such accurate calculations. So in most games, 500-750 meters is the realistic upper limit.
Now, let's leave the scene as is, and see how the wind effects the bullet's trajectory.