play sound on button enter in javascript

hey guys I’m a big noob in unity and I am trying really hard to learn but I don’t know how to trigger sound on movement key entry any help could be really helpful

#pragma strict

var forwardRate : float = 5;
var turnRate : float = 90;
var player:boolean;
function Update () 
{
// tank's forward speed in action
var forwardMoveAmount = Input.GetAxis("Vertical1") * forwardRate;

// force of the tank's turn
var turnForce = Input.GetAxis("Horizontal1") * turnRate;

// rotate tank in action
transform.Rotate(0,turnForce,0);

transform.position += transform.right * forwardMoveAmount * Time.deltaTime;
}

Hi,

As per my understanding on your question, you can check values of Input.GetAxis(“Vertical1”) and/or Input.GetAxis(“Horizontal1”) and if it is not zero then you can play the sound.