Update function not fast enough to run sound every time it is called
My problem seems to be that when I am running the update function, it calls sound files for my inventory to open, but only about half of the time. This makes me think that the update function is not fast enough to keep up with the input. here is my code :
void Update () {
if (gameMaster.isInventoryUIOn && invToggle) // this accesses another script to check a bool, making sure it can run the sound file {
Debug.Log ("On");
AudioSource.PlayClipAtPoint (inventoryOpen, myTransform.position, volume);
invToggle = false;
//checkTwice = false;
}
I tested the debug to make sure that it wasn't something I was inputting with the update, and it will print to the log correctly every time. Is there a better function to use to call this procedure?
Your answer
Follow this Question
Related Questions
how to access a method declared inside a script attached to child of another gameobject? 1 Answer
Unity Desert Sand Dunes 0 Answers
Check collission of rotating sprite is ground 0 Answers
How to fix Missing Reference Exception? 0 Answers
File.Move won't work : IOException: Win32 IO returned ERROR_ALREADY_EXISTS. Path: 0 Answers