how to enable a java script inside a gameobject on press of the space key?

hey, I’m trying to make a racing game and I would like it to start still until the space key is pressed

.thanks NITRO.P


(I’m using the latest unity 5.3.4 )

If you add this script:

var script_to_enable : Behaviour;

function Start () {
    script_to_enable.enabled = false;
}

function Update () {
    if(Input.GetKeyDown(KeyCode.Space)){
        script_to_enable.enabled = true;
    }
}

To your Game Object and then drag the nameOfScriptToControl script to the script_to_enable variable in the editor it should work.

I hope this helps!