void Shoot() { GameObject bulletGO = (GameObject)Instantiate(bulletPrefab, firePoint.position, firePoint.rotation); CannonBall bullet = bulletGO.GetComponent <CannonBall>(); if (bullet != null) { bullet.Seek(target, damage); } }