I have these two codes who work the same way. But when i build the game, the game crashes and says Oops. and exports a output_log.txt
Here is the code;
#pragma strict
var paPa : GameObject;
var audio1 : AudioSource = GetComponent.();
var audio2 : AudioSource = GetComponent.();
var isWinding = false;
var isItCharged = false;
var canWind : boolean = false;
var warningSign1 : GameObject;
var kill : GameObject;
var inTrigg : boolean = false;
var runner : GameObject;
var randomTime : int = Random.Range (20,45);
function Start () {
canWind = true;
warningSign1.active = false;
yield WaitForSeconds(15);
StartCountDown();
}
function StartCountDown () {
isItCharged = false;
Debug.Log("START COUNTDOWN");
yield WaitForSeconds(randomTime);
if( isWinding == false && isItCharged == false ) {
warningSign1.active = true;
}
yield WaitForSeconds(5);
runner.active = true;
yield WaitForSeconds(10);
if( isWinding == false && isItCharged == false ) {
kill.active = true;
}
else if ( isItCharged == true ) {
runner.active = false;
warningSign1.active = false;
}
}
function StartWinding () {
if ( isWinding == true && canWind == true ) {
GameObject.Find("PaPa").GetComponent.().mute = false;
yield WaitForSeconds(3);
if ( isWinding == true ) {
isItCharged = true;
}
}
}
function OnTriggerExit () {
isWinding = false;
StopWinding();
}
function StopWinding () {
if ( isWinding == false ) {
GameObject.Find("PaPa").GetComponent.().mute = true;
}
}
function OnTriggerEnter () {
inTrigg = true;
isWinding = true;
StartWinding();
if ( isItCharged == true ) {
audio2.mute = false;
StopWinding();
}
else {
audio2.mute = true;
}
}
][1]
[1]: /storage/temp/61979-output-log.txt
↧