I’ve got this script, which works fine but it takes at least a second for the controls to respond. What’s the problem?
using UnityEngine;
using System.Collections;
public class controls : MonoBehaviour {
public float speed = 0;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(Input.GetAxis("Vertical")==1){
transform.Translate(0,speed,0);
}
else if(Input.GetAxis("Vertical")==-1){
transform.Translate(0,-speed,0);
}
if(Input.GetAxis("Horizontal")==1){
transform.Translate(0,0,-speed);
}
else if(Input.GetAxis("Horizontal")==-1){
transform.Translate(0,0,speed);
}
}
}