VR development: Unity explainer 8 of 8

Add a soundtrack and attach sounds to individual objects.

All our VR workflow explainers are waffle-free and work-tested. That’s the pixels.cool guarantee!

Add a soundtrack and attach sounds to individual objects


Overview

Name of explainer:
Add a soundtrack and attach sounds to individual objects

Creative theme: VR development

Software used: Unity

User level: INTERMEDIATE

This is explainer 8 of 8 in this series

This series includes:

  1. Install the Unity hub and Unity LTS
  2. Download Oculus integration, create a new Unity project and set it up for VR
  3. Install VRIF and send a VR scene to a Quest 2 headset
  4. Import a low poly city scene and add a VR camera rig
  5. Edit a 3d object to interact with it in VR
  6. Import and set up animated people to populate the city
  7. Animate a police car to race around the city streets
  8. Add a soundtrack and attach sounds to individual objects

The Software

This series of explainers uses Unity, one of the most popular real-time 3d development environments. It’s used by millions of creators to develop games, create animations and visualisations and even produce short movies. Need inspiration? Check out their showcase.

Unity personal edition is completely free. If you start to make money commercially from your Unity creations you’ll need to upgrade to a paid professional license.

Over the course of eight explainers we’re using Unity and various free and paid assets from the Unity asset store to test a workflow from Unity to a Meta Quest 2 headset, send a city scene to the headset and add objects we can interact with. We go on to add animated people and a speeding police car! Finally, we import an ambient soundtrack and attach sounds to specific objects.

Our city at the end of this series

This is how our city looks at the end of this series. Remember the environment is designed to be experienced in a VR headset and not viewed as a ‘flat’ video!

The pre-requisities

This is an INTERMEDIATE workflow explainer series. We’re starting from scratch so don’t worry if you’ve never used Unity, but you’ll find this series easier to follow if you have basic knowledge of the Unity interface and how to navigate a 3d scene.

If you’re new to IT / computing, this workflow series is not likely to be suitable. To get started with 3d software in a beginner-friendly environment, we recommend the free Tinkercad. See makeuseof for a helpful overview of 3d design and the specialisms available to you.

Why would I do this?

Our city is currently completely silent! In this explainer we use mp3 audio files to add an ambient soundtrack to the scene in general, then to specific objects. By using spatial audio we can ensure the sound gets louder as we approach a person or object.

Let’s do it!

Click the play icon to watch this video. Subtitles are available – Click the settings cog at the bottom right for options. You can also watch this video full-screen by clicking the full-screen icon at the bottom right.

Good to know

In this explainer we use FREE music files downloaded from freemusicarchive, where you can find lots of audio files for personal use. Always check the license terms if you’ll be publishing your creations commercially.

Where to next?

Our VR city is complete! We hope you’ve enjoyed the virtual journey. You have the building blocks to import and edit scenes of your choice, add animated characters and objects, and add atmospheric sound! Here are ideas for the next steps of your journey…

A: Turn the city into a treasure hunt!

1: Create a clue image in your favourite image editor (See our image editing month for essential workflows!). We created the simple image below in PaintShop Pro and saved it as a .jpg file:

2: Add the image to an appropriate folder in your existing Unity city project:

3: Create a new 3d plane by going to GameObject, 3D Object, Plane:

4: Drag and drop the image onto the blank white plane:

5: Resize and rotate the plane to place it accurately within the scene:

Remember you can then make the clue plane grabbable if you’d like your character to be able to pick it up and view it. You could even attach a sound so your users know when they’re close to finding your clue!

B: GAMIFY YOUR VR CITY!

If you’re thinking ‘When my character picks up x, I want y to happen’, you’re ready to gamify your VR experience! There are lots of ways to approach this, from learning to code in C# to using ‘visual scripting’ assets like the popular playMaker:

C: Start a modelling career!

We’ve used pre-built objects in this series to let us focus on VR workflows, but why not build your own city? You can model directly inside Unity using a 3d modelling asset like Umodeler:

…or you can use dedicated modelling software to create models and send them to and from Unity. Below we’ve sent the Neon City Unity scene to Maya and rendered it using VRAY:

Neon city exported to FBX and imported to Maya
The VRAY render engine in Maya
A low-rez VRAY render

Arguably the most popular modelling and rendering software for newbies is BLENDER, which is completely free. Once you’ve mastered the basics, you’ll be able to transfer your 3d skills to almost any other 3d software package!

Notes and updates

There are no notes or advisories at this time. This video explainer was last updated in May 2022. This page was last updated in May 2022.

We at pixels.cool are not responsible for the content of any external webpages or software downloaded from third party sites. Links are included in good faith at the time of writing. All explainer content is compiled in good faith using processes and methods used by the team. Modern software offers users many ways to accomplish a single task, and for reasons of clarity we choose not to refer to multiple options. All computer users should run up to date virus / security software at all times to minimise risks of data loss.


This is number 8 of 8 explainer videos in this series. Make sure you check out the others!