Bullet Drop With Raycast

Before you start scolding me, I have checked many different search engines about this, including Unity Answers.
I am attempting to make a realistic post-apocalyptic game, and my bullets need some bullet drop. I made my shooting script like so:

if(ItemType == ItemTypeEnum.GunFullAuto){
    					if(AmmoInCurrentMag > 0){
    						ReloadAnim.animation.CrossFade(itemName + "Shoot", 0.1);
    						recoil2 -= new Vector3(0, 0, recoil / 2);
    						recoil4 -= new Vector3(recoil * 75, Random.Range(recoil * 100, -recoil * 100), 0);
    						recoilNeck += new Vector3(-recoil * 30, Random.Range(-recoil * 30, recoil * 30), 0);
    						fireTimer = 5;
    					} else {
    						ReloadAnim.animation.CrossFade(itemName + "Idle", 0.1);
    				} else {
    					ReloadAnim.animation.CrossFade(itemName + "Idle", 0.1);

You can ignore the FireTimer stuff, as that is irrelevant here. My bullet is a instantiated empty GO which will activate a Raycast, like so:

 function Start(){
    		networkView.RPC("SetOwner", RPCMode.All, Database.user);
    	var Hit : RaycastHit;
    	var temp : Vector3 = gameObject.transform.position + transform.forward * maxDistance;
    	Tracer.GetComponent(LineRenderer).SetPosition(0, gameObject.transform.position);
    	if(Physics.Raycast(transform.position, transform.forward, Hit, maxDistance)){
    				var myMetal = Instantiate(HitMetal, Hit.point + (Hit.normal * HitParticleSpacing), Quaternion.LookRotation(Hit.normal));
    				myMetal.transform.Rotate(90, 0, 0);
    				myMetal.transform.parent = Hit.collider.gameObject.transform;
    			if(Hit.collider.gameObject.tag == "Player"){
    				Hit.collider.gameObject.GetComponent(PlayerHealthScript).Blood -= damage;
    				Hit.collider.gameObject.GetComponent(PlayerHealthScript).BleedingLevel += damageBleed;
    			Tracer.GetComponent(LineRenderer).SetPosition(1, Hit.point);
    		} else {
    			Tracer.GetComponent(LineRenderer).SetPosition(1, temp);
    	} else {
    		Tracer.GetComponent(LineRenderer).SetPosition(1, temp);

Anyone have any idea how I can make a bullet drop OTHER THAN ROTATING THE BULLET? I should not rotate the bullet as in multiplayer the tracer would look diagonal…

As an approximation, you can add a slight downward rotation to the firing vector. This will cause the bullet to drop more the further the target is from the gun.

var firingVector = transform.forward;
var axis = Vector3.Cross(firingVector, Vector3.down);
firingVector = Quaternion.AngleAxis(smallAngle, axis) * firingVector;

You may have to reverse the parameters in the Vector3.Cross, or alternately change the sign of ‘smallAngle’. You use firingVector in place of transformForward in the Raycast(). This will work well as long as the character is aiming somewhat horizontally. If you are allowing your character to shoot nearly straight up or down, then you’d need something a bit more complex.

Like bullet drop gravity? like in bf3? Then do this have the gmae make multiple frames of the linerenderer and render a new ray to the drop just delete render delete render, down and down, other then that sorry

Search google for trajectory maths.

Using the distance returned from the raycast, decide your own figures for speed and mass and use trajectory maths to work out your bullet drop at the given distance.

For the sake of saving fps it may be worth reusing the value worked out in the first bullet calculations for the next bullets if the distance returned is within 1 unit, for example.

Basically you work out the distance a projectile falls in the time it takes for the projectile to reach the target at a given velocity. The two axes can be handles separately.

You could also make your bullets use rigidbodies. 90% of the time it will just pass through whatever you shoot and keep going on. That’s why you should shoot a raycast from your bullet out 5 meters or so. If anything touches it, it’s as good enough of a hit as any. Alternatively, you can shoot the raycast backwards.