hello passing good samaritan,
I randomly got the ‘Cannot play disabled audio source’ error when nothing had been changed except the audio file used (audio file to trigger when player dies).
Reading around a few other threads with this same error it looks like the player (object?) is null or inactive so because the audio is part of it, it’s inactive too.
I tried changing the order of the line and a few of the solutions posted elsewhere but I’m just starting to learn code and really am not armed to solve it
any suggestions good people?
Thanks!
public IEnumerator RespawnCo()
{
thePlayer.gameObject.SetActive (false);
Instantiate (deathEffect, thePlayer.transform.position, thePlayer.transform.rotation);
thePlayer.hurtSound.Play ();
yield return new WaitForSeconds (waitToRespawn);
thePlayer.transform.position = thePlayer.respawnPosition;
thePlayer.gameObject.SetActive (true);