How do i attach this prefab to the script?

using UnityEngine;
using System.Collections;

public class NewBehaviourScript1 : MonoBehaviour {
public GameObject grenade_prefab;
// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
	if(Input.GetButton("Fire1")(  
}

}
Ive just started this new script and ive made a grenade prefab and im trying to attach to the script in unity but the gameobject bit isnt showing up in the inspector column could someone please help me? :slight_smile:

You could make it like this

}
     public GameObject grenade;
    // Update is called once per frame
    void Update () {
    if(Input.GetButton("Fire1")(
    }

Then when selecting the GameObject in unity. The Inspecter change the variable, and in the tabs go to assets and chose youโ€™re grenade.

You need to use the [18745-kuvankaappaus+2013-12-1+kello+15.21.59.png|18745] Directory to Drag And Drop the prefab into the inspector.

I had the same problem with a missile script. I hope this helps!