- Home /
Question by
Ross Dickinson · Apr 27, 2013 at 08:14 PM ·
javascriptjavafootsteps
Footsteps Java Script Problems
Basically I'm creating a virtual reality where I want to make a footstep sound on selective planes, but I'm having problems with my coding, I keep getting error messages when trying to open it in Unity. Also when I'm trying to choose my audio files via audio.clip=BleepSound; it's not coming up as something I can select to attach the audio clip to it, if that makes any sense. I've attached a screenshot of the javascript and the error messages. Any help would be really great. Thanks.
var AudioTimer : float = 0;
var BleepSound: AudioClip;
function Update () {
if (AudioTimer > 0) {
AudioTimer -= Time.deltaTime;
}
if ( AudioTimer < 0){
AudioTimer = 0;
}
}
function OnControllerColliderHit (col: ControllerColliderHit){
if (col.gameObject.CompareTag("Bleep") && Input.GetAxis)("Vertical") && AudioTimer == 0 ||
Input.GetAxis("Horizontal") && AudioTimer == 0 ){
audio.clip = BleepSound;
audio.PlayOneShot(BleepSound);
AudioTimer = 0.4;
}
}
error1.png
(403.8 kB)
error2.png
(107.0 kB)
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Setting Scroll View Width GUILayout 1 Answer
Can someone help me fix my Javascript for Flickering Light? 6 Answers
Pain in the ass 2 Answers
Simple Timer 2 Answers