I have a sound which works fine when it is set as the audio source of the whole level, but i want it to play only when I press a button so I have a simple script like this
var MySound : AudioSource;
function update(){
if(Input.GetButton("Jump")){
MySound.Play();
}}