- Home /
How would I go to add the Players Voice in the game?
I have recorded over 10 voices like when the player picks up ammo, or destorys an alien,
like (Player killed enemie. (Voice):"COME GET SOME!" said the player.)
lol, something like that. I guess.. But have a group so it plays random voices when the
player interacts with something from that. is there an easy way to script this? if so
please Tell me >:(
and this is a question!!
Answer by nixtwiz · Aug 09, 2012 at 12:46 AM
There is a way to do it, whether or not it's easy depends on your scripting knowledge ;)
You could create an array for each group of voices and have each index refer to one of that group's voice. Then when the event happens you create a random number from 0 to your highest index of the appropriate array and then play the sound on that index.
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
How to make a normalized movement script? 1 Answer
Strange AudioSource issue, hogging resources 1 Answer
C# Script is affecting multiple GameObjects but I would like it to only affect one of them... 1 Answer
Web player mouse tracking change between 2.6 and 3.0? 0 Answers