- Home /
play music on key press
I want to play a sound when I pressed number 1 key on the keyboard, how do I do it?
Comment
Answer by ikriz · Jun 20, 2012 at 07:10 PM
Something like this?
if(Input.GetKeyDown(KeyCode.Alpha1)) audio.Play();
Your answer
![](https://koobas.hobune.stream/wayback/20220613073041im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
play music on key press 1 Answer
End game then an Object is close to another object? 0 Answers
Rpg Food/Survival script Need help!! 0 Answers
Teleport enemy after player collides with an object? 0 Answers