protected void InstantiateAndShootProjectile(GameObject projectile, Transform source, Transform target) { BaseProjectile baseProjectile = Instantiate(projectile, source.position, new Quaternion()) .GetComponent <BaseProjectile>(); baseProjectile.Shoot(target.position); }