Open nosymmetree opened 11 years ago
in playerController.js:
var laserPrefab:Rigidbody;
//fire at left apple key
if(Input.GetKeyDown(KeyCode.LeftControl)){
//create a bullet at th position of the spaceship
Instantiate(laserPrefab,transform.position,transform.rotation);
//the laser shot counter
laserShots++;
//audiosource for the laser being shot
GetComponent(AudioSource).clip = laserSounds[ Random.Range(0,laserSounds.Length)];
GetComponent(AudioSource).Play();
}
I cannot make the spaceship shoot the laser