Hi guys,
I am trying to catch any errors while recording/accessing the mic but it doesn’t seem to catch this error and then the game breaks and I can’t click anymore buttons because of it.
Here is the code and error…does anyone know why?
Looks like that method doesn’t actually throw an exception. Documentation says that the returned audio clip will be null if recording failed so you can check that instead.
The error is a ‘error initializing output device’ and occurs before i could do a null check on it. I just checked and it actually IS catching the error and _success is set to false, but the error still occurs and breaks the game
Ah I think I found the problem
I had a gui message pop up with an “OK” button, but the OK button wasn’t clickable and I thought that was because of the error…but it’s because of my own code and i wasn’t setting a bool back to false.
I haven’t been able to double check if that WAS it because the error is intermittent on my PC but I am pretty sure that was it
Thanks
Yea never assume things, I can speak of experience Always make sure if things really happen or not by adding a log in catch for instance, at least during development.