//Shoot function shoots a bullet/missile projectile towards the target. void Shoot() { GameObject bulletGameObject = (GameObject)Instantiate(bulletPrefab, bulletSpawnPoint.position, bulletSpawnPoint.rotation); BulletScript bullet = bulletGameObject.GetComponent <BulletScript>(); if (bullet != null) { bullet.SeekTarget(target); } }