Quantcast
Channel: Questions in topic: "crash"
Viewing all articles
Browse latest Browse all 2383

Unity crashes when it tries to play a sound!

$
0
0
Hello, everyone I have a problem that i don't know exactly why it is happening! I have assigned my script to the player and then i did add audio source to the player The problem is that, when Unity tries to play the sound it suddenly crashes! The idea is that i want to check if the sound is playing or not, and if it is not playing then, it starts playing by fading in Here is my code: void Update() { FadeInSound(); } void FadeInSound() { float i; if(Input.GetKey("up")) { if(audio.isPlaying == false) { for(i = 10; i > 0; i++) { audio.volume = i * 0.1F; } } } } Please help me Thank you all for your time, any help is greatly appreciated.

Viewing all articles
Browse latest Browse all 2383

Trending Articles



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