I have the free version of Unity. I was wondering if there was anyway at all to get voices into your game. For example I would like the player to run up to someone and they say something to them. Something like
NPC- Be carful there’s zombies here.
Player- Great, an over used concept.
I would like to be able to have a back and forth. Or be able to have a “mission briefing” before the level. A voice tells you about the level along with text.
Is any of this possible? I’ve looked up tutorials and never found any.
Well, a simple collision trigger could be used to fire an event between two game objects. (the player and the npc) For playing back audio, you would just need an audio source attached to the player-perspective camera and the NPC. The rest is just a matter of timing.
I would suggest tackling other problems before you get into something specific like triggered audio. By the time you actually need them, you’ll know how to do them already.
I know they changed some things up for the Audio in the latest version of Unity. (5.0) But I’ve found in previous versions that getting basic audio to play back has actually been fairly easy.
To start, you will want to record some audio to use. If you have any microphone at all, you’re set. You don’t have to worry about your vocal performance being extremely clear, or even particularly good. For testing purposes you just need a basic voice that can be understood. Grab a copy of Audacity, record a few test sentences, and save them in a compressed format such as MP3 or OGG. Drop those files somewhere into your Unity project’s folder.
They should now show up as Audio Clips. You should now be able to edit their import settings in Unity, as well as assign them to Audio controllers on your game objects, and play them back. I haven’t tried this yet in Unity 5, so I can’t speak to the details of this process, but in 4.6 it was rather straightforward. An AudioSource component gets applied to an object. An AudioListener component needs to be applied somewhere else in the scene. (the default camera comes with the component already applied) AudioClip resources from the Assets folder can be assigned to and played from Audio Sources. The rest was just rigging up the interactivity.