Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

[n00b] Can not play a disabled audio source.

$
0
0
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);

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>