var CameraTarget : GameObject;
function Awake () {
Invoke("activateSS", 0.1);
}
function activateSS () {
CameraTarget.GetComponent(BlurEffect).enabled = false;
audio.Play();
Invoke("deactivateSS", 3);
}
function deactivateSS () {
CameraTarget.GetComponent(BlurEffect).enabled = false;
audio.Stop();
}
The preceding script is designed to activate both a sound and the blur effect script. The result is spose to be ringing ears and blurred vision which will be triggered by an explosion going off near bye. In essence Sensor Shock. The CameraTarget variable is the main camera. The audio begins playing however, the blur effect script does not work and the audio does not stop after the 3 seconds. I'm relatively inexperienced with UnityJS and any insight into the problem would be greatly appreciated.