Let’s get this out of the way now:
“Play automatically” is not checked.
The loop mode is set to “once.”
In the script there is a condition check which says
“if you have 10 photos, the animation will play.”
And yet, the animation plays right from the beginning.
Scratching my head on this one, because I’m guessing that the answer is so simple that I’ll kick myself for not thinking of it. So hey, I’m hoping you’ll kick me. Err, help me. Any help is humbly appreciated. God bless.
Animation Script: - Please note: also tried in Update
function Start (){
if(CameraFlash.picture >= 10);
gatefall();
}
function gatefall () {
yield WaitForSeconds(1.0);
animation.Play();
}
Photo Script
var flash : GameObject;
var cameraSound : AudioClip;
static var picture : int = 0;
static var takepicture : boolean = false;
function Start() {
flash.SetActive(false);
}
function Update() {
if(Input.GetButtonDown("Sword Slash")){
if(Inventory.inventoryArray[4] >= 1)
{
AudioSource.PlayClipAtPoint(cameraSound, transform.position);
picture++;
takepicture = true;
flash.SetActiveRecursively(true);
StopFlash();
}
}
}
function StopFlash() {
yield WaitForSeconds(1.0);
flash.SetActiveRecursively(false);
}