void Rocket()
{
currentAmmo–;
GameObject gameObject = Instantiate(projectile, transform) as GameObject;
Rigidbody rb = gameObject.GetComponent<Rigidbody>();
rb.velocity = transform.forward * projectileSpeed;
}
void Fire()
{
currentAmmo--;
GameObject gameObject = Instantiate(projectile, transform) as GameObject;
Rigidbody rb = gameObject.GetComponent<Rigidbody>();
rb.velocity = transform.forward * projectileSpeed;
}
I can’t get my projectile to deal damage based on a varible in the script.