I have a button, it leads to a new scene but I also want it to make a noise when clicked. I have two different scripts, one for changing scenes and one for making the clicking noise. The weird part is that the noise works but only sometimes.
Private IEnumerator DoTheThing()
//Do your first thing
yield return new WaitForSeconds(1.5f)
//Do your Second thing
I don’t think the execution order of multiple OnClick events is guaranteed. So, i bet your problem is related to timing. Sometimes, the scene is probably changing before the sound is played.
You can probably solve the issue by calling a single OnClick method that does both things - in the order you want.