How Sound effects works (Guide)

It seems like no one has touched on how sound works in Unturned, so I guess I’m the one to start it.

Let’s discuss how sound works in Unturned. What the functions are for, as well as a couple of recommendations and much more.

Firstly we can start with, how to add sound effects to your object, barricade, or even item.
Everything starts from a component called ‘Audio Source’, which you can find here:
Click on ‘Add component’ and search there.

image

You can put the ‘Audio Source’ component in the new game object, which will allow you to move your sound source.

image

You’ll get a table with lots of feature settings, many of which You won’t use. (most likely)
Make sure you have ‘Spatial Blend’ enabled as 3D. Otherwise, sound will be heard no matter how far away.

Play On Awake - This means that any interactibility will start playing the sound, so leave it checked there.

Loop - This simply, means that even if the audio track of your audio ends, the audio itself will not stop, but will start again on a loop. (e.g. - Cobalt’s environment ambiance is looped.)

image

I’d recommend you have always ‘Linear Rolloff’ enabled instead of Logarithmic Rolloff.

Other types of rolloff, are simply not meant for Unturned and are useless. The high or low value of sound is imperceptible, but if you care about that, you can play with it.

image

Min distance (2 meters) is the source of the sound, and Max distance (9 meters) is the muffling, or we can call it also the echo.

image

The latest one is just to drag your sound file.
I’d recommend placing your sound file near to object or any prefab, it doesn’t matter where exactly it should be, but that’s how I used to. In the audio source just drag it here.

image

image

Now we’ll talk about sound files.

The most used sound file types are:
.Wav
.MP3
.Ogg

.Wav - Common file type, one of the differences is that it weighs a lot, even with good optimization.
MP3 - The most popular type, it’s much smaller than the .wav type.
.Ogg - Is probably the best option. It has a really small size than .wav and MP3 all of them combined.

The sound quality will be virtually unaffected by sound type

Load Type - If you have sounds that will be used for Envrioment Sound, (Day, Night) click on ‘Compressed in Memory’. Otherwise, it won’t work.

image

Streaming and Decompress On Load are the same, but ‘Decompress On Load’ is used for example, if you have an object or barricade without MasterBundling.

You can leave ‘Streaming’ in case you use MasterBundle.

Quality - If you need to reduce the size, reduce quality to 1. (It will have no difference)

Sample Rate Setting - ‘Preserve Sample Rate’ is turned by default, but if you need to make the sound quality worse so that it is more significant and there is a real difference in optimization, then choose: ‘Override Sample Rate’

image

The lower the number of hertz (Hz), the worse the sound becomes (the most optimal is 22,050 or default 44,100)

image

Choosing 22,050Hz will get rid of the error that will pop up if you have -ValidateAssets enabled (Shows errors that are not significant but can be fixed).

I recommend enabling this button so that you can hear and adjust the sound immediately in unity without launching the game.

image

If You think that I missed something or that there is a mistake, comment on it, thanks!
This is all the basic stuff that you should know about the sound effect. Good luck with Your projects!

7 Likes

Awesome guide!

3 Likes

Yes, thanks for sharing your findings with everyone!

Have you considered adding community made guides like this to the offical documentation? They are very helpful and it would be nice if it could be added, with permission of course, so more people could see it.

Some guides would make more sense as a Steam Guide, forum post, etc. instead (e.g., for very niche use-cases, things things not as directly related to Unturned, or topics better covered by other sites like Unity’s official documentation).

But the Unturned Documentation can be contributed to from GitHub, meaning that anyone can submit changes. Several of the commits over the last few years were made by community members. :slight_smile:

1 Like

Yeah I agree It would be better if I remade this guide for Steam or on Github, in any case, if I find the time, I’ll rewrite it there. Thanks

1 Like

the more you know…

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.