- Home /
This post has been wikified, any user with enough reputation can edit it.
Question by
greengiant1177 · Jan 16, 2013 at 11:09 PM ·
sounddoor
Two sounds from one keypress
This gotta be easy. I have this script for my "dooropen" sound
var Trigger : AudioClip;
function OnTriggerStay(){ //when he enters the trigger zone if (Input.GetKeyDown ("e")) { //if he presses the E key audio.Play(); //audio plays } }
But if the door is open a second sound shall be heard. Cant get it to work. What shall the complete code look like? /Thanks/
Comment
Answer by cdrandin · Jan 16, 2013 at 11:19 PM
Refer to http://answers.unity3d.com/questions/240468/how-to-play-multiple-audioclips-from-the-same-obje.html
Your answer
Follow this Question
Related Questions
Door Sound Script Help 1 Answer
This door script causing door to go crazy? 2 Answers
Door opens, plays sound, but can't close it. 2 Answers