So, I am trying to get a mesh X-Wing to fire two shots with a public variable to determine the time between the shots. The only problem with the controller is some errors I don’t know how to fix. The controller script is pasted below. //errors look like this.
using UnityEngine;
using System.Collections;
public class X-WingWeaponController : MonoBehaviour
{
public GameObject shot;
public Transform shotSpawn;
public Transform shotSpawn2;
public float fireRate;
public float delay;
public float timeBetweenShots;
void Start ();
{ //*Invalid Token '{' in class, struct, or interface member declaration*
InvokeRepeating (Fire, delay, fireRate) //*Method must have return type, ',',',')' Expected.*
} *//Invalid Token '}' in class, struct, or interface member declaration*
void Fire (); //*A Namespace cannot directly contain members such as fields or methods.*
{
Instantiate (shot, shotSpawn.position, shotSpawn.rotation);
GetComponent<AudioSource>().Play();
WaitForSeconds (timeBetweenShots);
Instantiate (shot, shotSpawn2.position, shotSpawn2.rotation);
GetComponent<AudioSource> ().Play ();
}
} //*Type or namespace definition, or end-of-line expected*