0 || Input.GetKey (KeyCode.Joystick1Button2)){ if (accelerate == false){ audio.Play(); } accelerate = true; } else{ accelerate = false; }, 2.public var acelerateSound: AudioSource; // its attached to refenrenced function Update() { if(Input.GetAxisRaw("Vertical") > 0 || Input.GetKey (KeyCode.Joystick1Button2)) { accelerate = true; acelerateSound.Play(); } else accelerate = false; }, 3.if (Input.GetAxisRaw("Vertical") > 0 || Input.GetKey (KeyCode.Joystick1Button2)){ if (accelerate == false){ audio.Play(); } accelerate = true; } else{ accelerate = false; }, 4.public var acelerateSound: AudioSource; // its attached to refenrenced function Update() { if(!Input.GetAxisRaw("Vertical") > 0 || Input.GetKey (KeyCode.Joystick1Button2)) { accelerate = true; acelerateSound.Play(); } else accelerate = false; }">
MCQs > IT & Programming > Unity3D > How can you update using the following code function to play a sound once?

Unity3D MCQs

How can you update using the following code function to play a sound once?

Answer

Correct Answer: if (Input.GetAxisRaw("Vertical") > 0 || Input.GetKey (KeyCode.Joystick1Button2)){ if (accelerate == false){ audio.Play(); } accelerate = true; } else{ accelerate = false; }

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Unity3D Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Unity3D Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it