Play audio on keyboard click?

Hi I have a simple script that plays different audio clips on various button or mouse clicks, now I have the code setup to play an audio clip that is assigned in a public variable on left mouse click, but I need it to do that and also play the audio that is assigned to the audio source when I click the up and down arrow keys, I thought I had it figured out, but it keeps giving me the error/errors below. Also Please give me the code in C# thanks.

Assets/AudioTrigger.cs(21,17): error CS0029: Cannot implicitly convert type float' to bool’

Here’s the code I’m using:
using UnityEngine;
using System.Collections;

public class AudioTrigger : MonoBehaviour
public AudioClip swing;
// Use this for initialization
void Start ()

// Update is called once per frame
void Update () 



Your problem is with Input.GetAxis which returns a float.

From the documentation:

The value will be in the range -1…1 for keyboard and joystick input. If the axis is setup to be delta mouse movement, the mouse delta is multiplied by the axis sensitivity and the range is not -1…1.

The should look like:

if(Input.GetAxis("Vertical") > 0)

// or

if(Input.GetAxis("Vertical") < 0)