AlexM
New member
Hello! I'm writing my own script for processing damage done from weapons. The idea is that you can use different bullet types for each gun (fire, ice, normal, etc.), and the script will add the gun's base damage to the bullet. The damage values will be combined on the bullet itself, then received by different script on the hit character that reduces damage based on resistances to damage types.
To get my current solution to work, I need a script placed on the gun to get the projectile it just fired. I can't quite figure out how to do this, as the ShootableWeapon script seems to keep the SpawnedProjectile variable private. I also can't just use the prefab because the damage values need to be added onto the projectile's custom script at runtime.
Sorry if this is a bit convoluted. Basically my question is, how would I get the exact projectile spawned from the gun itself, as soon as it's fired? Any help would be much appreciated. Thank you!!
To get my current solution to work, I need a script placed on the gun to get the projectile it just fired. I can't quite figure out how to do this, as the ShootableWeapon script seems to keep the SpawnedProjectile variable private. I also can't just use the prefab because the damage values need to be added onto the projectile's custom script at runtime.
Sorry if this is a bit convoluted. Basically my question is, how would I get the exact projectile spawned from the gun itself, as soon as it's fired? Any help would be much appreciated. Thank you!!