Hi so basically I have a script that shoots but I want players to have stats and guns to have their own damage
So I have the bullet that is instantiated and the bullet works out the damage it does but I want it to work out the damage using the gun it is shot from and the person that shot it
Hierarchy example
Player1 > Character > Weapons > Assault_Rifle
I have a script on Assault_Rifle
if (Input.GetButton("Fire1") && Time.time > nextShot && clipBullets > 0 && curReload == false) {
nextShot = Time.time + gunStats.fireDelay;
Rigidbody bulletInstance;
bulletInstance = Instantiate(wepBullet, gunBarrel.transform.position, gunBarrel.transform.rotation) as Rigidbody;
bulletInstance.AddForce(gunBarrel.transform.forward * bulletSpeed);
gunBarrel.GetComponent<AudioSource>().Play();
clipBullets = clipBullets - 1;
ammoText.text = (clipBullets + " / " + gunStats.clipSize);
}
script for weapon damage is on Assault_Rifle, script for % bonuses against species is on Character