I have a function like this:
//Generic Factoids Call Up
public void GenericFactoidCall(){
source.PlayOneShot (FactoidsCallClips [Random.Range (0, FactoidsCallClips.Length)]);
}
The trouble is that I have a bool on another script called “KITT_isSpeaking” that I want to change when the Audio Clip Ends, I’m currently doing this in Update:
void Update(){
if (source.isPlaying) {
Debug.Log ("KITT IS TALKING");
KITTmodesObject.KITT_isSpeaking = true;
}
if (!source.isPlaying){
Debug.Log ("KITT IS NOT TALKING");
KITTmodesObject.KITT_isSpeaking = false;
}
}
now this does work for the most part, but the problem I have is that in the other script I have a coroutine that tries to make the:
“KITT_isSpeaking” bool True when it starts…
But the update in the Other script changes it back to False.
is there a way for me to have the bool in the coroutine able to change the bool and not have the update in the other script cancels that out?