I have an issue, where the audio wont play. its on a spot light object inside a camera. the spot light has the following script and has audio source components and the player object (houses the camera) has a audio listener. YET I HEAR NO SOUND…
using UnityEngine;
using System.Collections;
public class torchscript : MonoBehaviour {
public bool on = false;
public AudioClip FlashOff;
void Update()
{
if(Input.GetKeyDown(KeyCode.F))
on = !on;
if(on)
light.enabled = true;
else if(!on)
light.enabled = false;
audio.PlayOneShot(FlashOff, 0.7F);
}
}
i know theres been a lot of problems with this for people before…