Massive delay in controls

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

Nevermind. I think I know what the bug is :wink:

More efficient, framerate independent and fixed bug:

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 () {
		transform.Translate(0,Input.GetAxis("Vertical")*speed*Time.deltaTime,-Input.GetAxis("Horizontal")*speed*Time.deltaTime);
	}
}

Change the settings for gravity, etc. in the input manager.

–Eric