Posted May 21, 2022
Unity is new software for me.
I am sharing what I find helpful, in this case setting up Random audio using some scripts from learn.unity.com – I am working on macOS with an Oculus Quest 2.
I hope your find it helpful.
If you have 30 hours, take a look at the Unity: Create with VR Course – highly recommended!
I had to figure out how to add the random audio for a project challenge, so I thought I would share how I did it.
2. Start by getting the scripts from the Create with VR Starter Project … we will need the two scripts ‘Play Sounds From List’ and ‘On Timed Intervals’. The files are in the _Course LIbrary folder
2. Next, select a game object and add some audio, make sure to set ‘Spatial Blend’ to 1 (3D).
3. Now we will ‘Add Component’ – Play Sounds From List
4. Add the audio clips you want to use for your random audio.
5. Add Component – On Timed Intervals
6. Set the Min interval (minimum amount of time between audio clips) and Max interval (maximum amount of time between audio clips).
7. Where it shows (None (Object) …. drag in your game object, in my case it is called ‘Tree_Med’ from the Hierarchy, and then we will be able to set the function, in my case I set it to ‘PlaySoundsFromList.RandomClip’.
You should be able to save, build and run and test your random audio in VR.
Let me know if this tutorial helped.
Excellent video from Unity on all of the steps of setting up your first VR Scene – https://learn.unity.com/course/create-with-vr?uv=2020.3
Rob Shocks XR Guide – helped me a lot – https://www.youtube.com/watch?v=JyxbA2bm7os
Sideloading Apps on Oculus Quest – https://learn.adafruit.com/sideloading-on-oculus-quest/enable-developer-mode