Is there something wrong with my code because it gives me this error:
1)The best overloaded method match for UnityEngine.Vector3.Vector3(float, float, float)' has some invalid arguments 2)Argument
#1’ cannot convert bool' expression to type
float’
Here’s my code:
using UnityEngine;
using System.Collections;
public class Player : MonoBehaviour {
public float movSpeed;
public float rotSpeed;
public Vector3 input;
public Vector3 rotation;
void Start ()
{
}
void Update ()
{
input = new Vector3(Input.GetKeyDown(KeyCode.W), 0f, Input.GetKeyDown(KeyCode.S));
rotation = new Vector3(0f, Input.GetKeyDown(KeyCode.L), Input.GetKeyDown(KeyCode.K));
transform.Translate(input * movSpeed * Time.deltaTime);
transform.Rotate(rotation * rotSpeed * Time.deltaTime);
}
}