Input.GetAxis("Horizontal") problem

Hey I am wondering why I am getting the errors:Cannot implicitly convert type ‘float’ to ‘bool’ , and Vector3 is a type, but used like a variable. This version of the script apparently works for JavaScript, but for C# it is not working, and the Documentation on it looks the same as I typed it in.

Here is the code:

using UnityEngine;
using System.Collections;

public class player_script : MonoBehaviour {
    int health = 100;
    int speed = 5;
	// Use this for initialization
	void Start () {
	// Update is called once per frame
	void Update () {

        if (Input.GetAxis("Horizontal"))
            transform.Translate(Vector3(Input.GetAxis("Horizontal") * speed * Time.deltaTime, 0,0));


Hey everyone I figured it out, the Input.GetAxis(stringhere) returns a float so I have to make something like:

if(Input.GetAxis(“Horizontal”) != 0)
//do something

and it worked fine.

this should fix it also if you search the scripting reference for move there a great walk out of a movement script


you can also do:

float x = input.getaxis("horizontal");

but with the right capital letters