I’m following a tutorial on how to write a simple fire projectiles script, and it appears I’m either missing something, or I’ve added an extra symbol somewhere that I’m not seeing. I’m currently receiving multiple unexpected symbol error messages and a parsing error all within the ‘void Fire’ section. The errors are:
Assets/Scripts/PlaneShooting.cs(57,9): error CS1519: Unexpected symbol `{’ in class, struct, or interface member declaration
Assets/Scripts/PlaneShooting.cs(58,30): error CS1519: Unexpected symbol `>’ in class, struct, or interface member declaration
Assets/Scripts/PlaneShooting.cs(63,18): error CS8025: Parsing error
public class PlaneShooting : MonoBehaviour {
public float coolDown = 0f;
public float fireRate = 0f;
//check to see if actually firing
public bool isFiring = false;
//firing point transforms for launching projectiles
public Transform leftFirePoint;
public Transform rightFirePoint;
//projectile object
public GameObject laserPrefab;
//blaster sound effect
public AudioSource BlasterSFX;
// Use this for initialization
void Start () {
isFiring = false;
}
// Update is called once per frame
void Update () {
CheckInput ();
coolDown -= Time.deltaTime;
if (isFiring == true)
{
//the player has initiated shooting
Fire();
}
}
void CheckInput ()
{
if (Input.GetKeyDown ("space"))
{
isFiring = true;
}
else
{
isFiring = false;
}
}
void Fire ();
{
if (coolDown > 0)
{
return; //do not fire
}
//play SFX when player is firing
if(BlasterSFX != null)
{
BlasterSFX.Play ();
}
GameObject.Instantiate (laserPrefab, leftFirePoint.position, leftFirepoint.rotation);
GameObject.Instantiate (laserPrefab, rightFirePoint.position, rightFirepoint.rotation);
coolDown = fireRate;
}
}
Any help is much appreciated.