Right now when I hit play in Unity a cube Instantitates right away. I am trying to have the cube instantiate on Input,(when I press T) but I am having a lot of trouble. When I execute the code in the Update method or FixedUpdate method it just spawns a ton of cubes. My code is below in C#. As you can see I have the code executed in the Start method. Any help is appreciated. Thank you for your time.
using UnityEngine;
using System.Collections;
public class Creator : MonoBehaviour {
public GameObject thePrefab;
// Use this for initialization
void Start () {
if(Input.GetKeyDown(KeyCode.T));
GameObject instance = Instantiate(thePrefab, transform.position, transform.rotation) as GameObject;
}
}