Don't forget to set the volume of your AudioSource!
So, i was struggling a lot with this project cause the SOUND WOULD NOT PLAY in the build, but everything was fine in the Unity editor.
I tried everything, got very confused, posted a long chaotic devlog in here... and after taking a break from this problem...
well, i found the solution and fixed it in a matter of seconds.
What was the real problem here?
// example unity's c# code statement before the fix
audioSource.PlayOneShot(theAudioClip);
in my scripts, i had everything right, but i forgot to set the volume for 2 (out of the 3) moments where the Audio Source would play.
// example unity's c# code statement AFTER the fix
audioSource.PlayOneShot(theAudioClip, 0.7f);
All i had to do to fix it was... set the volume. Just adding two simple '0.7f''s in there would have avoided me and the game being messed up with for a few days.
aBoxCollecThingys
you're a box that collects diamonds. let's play?
Status | Released |
Author | adulaidyeet |
Genre | Platformer |
Tags | 2D, begginer, krita, LGBT, simple-art, Unity |
Languages | English |
Accessibility | High-contrast |
More posts
- The game may not have sound, but it's completed.Aug 11, 2021
Leave a comment
Log in with itch.io to leave a comment.