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));
}
}
}