How to Play a BGM at Your World【HEOAudio】
In this article, we will explain how to play BGM in the world of Vket Cloud.
Even in the same world, if the BGM is different, the impression will change.
Let's do it right away!
❶ Select and import the sound source file
First, select the sound source file you want to put in, and add it to any folder in Unity's Project window "Assets" by dragging and dropping. (Data format supports only MP3)
Once the import is complete, it will appear like the image.
❷Add item to Hierarchy
Next, create an object called "BGM" in the Hierarchy.
(1) Select "world" in Hierarchy > Right click > Create Empty
(2) An object named "GameObject" is created.
(3) Let's change the name to "BGM" to make it easier to understand .
If you change it in Inspector, the name in Hierarchy will be changed automatically.
❸ Add the "HEOAudio" Component
Let's add "HEOAudio" from "Add Component" in the Inspector .
"HEOAudio" has been added.
❹ Put the sound source file in "Audio Clip"
Let's drag and drop the sound source file from the project window to the "Audio Clip" field in the "HEOAudio" we just added.
Alternatively, you can click the button on the right side of the "Audio Clip" field and select from "Select Audio Clip".
❺ Check "loop" and "autoplay"
In this state, it will not play even if you enter the world. By checking the "loop" and "autoplay"
items below, it will be played automatically and the sound source file will be looped.
"loop": Loop setting to be played repeatedly
"autoplay": Setting to be played automatically when entering the world
BGM settings are now complete!
Let's build and run right away and see if you can hear the background music.
*Be sure to perform Clear Cache before Build And Run.
Clear Cache procedure
VketCloud SDK Manual for HEOAudio