I'm using the "Game Jam Menu Template" plugin from the asset store in a project of mine and I'm having a bit of a problem with it. See, I'd like it so that a particular button in the menu plays a sound before transitioning to the next scene. I've tried a number of ways to accomplish this so far, but none seem to be working. I initially tried attaching the AudioSource.Play method to the On Click () events for my button, but that didn't work. It seems that the StartOptions.StartButtonClicked method is interfering with the AudioSource's ability to play for some reason (that method is used to transition to the next scene in this plugin). So, I tried patching that function itself, by both running this.gameObject.GetComponent<AudioSource>.Play() at the beginning of it, as well as finding the object I wanted by tag and then attempting to play its AudioSource. However, both of these attempts at forcing the sound to play were unsuccessful as well and I'm kind of at a loss as to what to do now. Is there a way for a button that transitions to the next scene via StartOptions.StartButtonClicked to play an AudioSource before doing so in this "Game Jam Menu Template" plugin?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.