View before place a object

Hi guys,

Can I ask about help with script?

I am creating a script with set prefab on scene. It works fine, but I want a put code which show the prefab (transparent) before put it on scene.

var prefab : GameObject[];
var player : Transform;

private var pos : Vector3;

function LateUpdate () {
    pos = new Vector3(player.position.x, player.position.y, player.position.z + 3);
   
    if(Input.GetKeyDown(KeyCode.Keypad0)) {
            if(Input.GetKeyDown(KeyCode.Mouse0)){
                    Instantiate(prefab[0], pos , player.rotation);    
            }
    }else if(Input.GetKeyDown(KeyCode.Keypad1)) {
            Instantiate(prefab[1], pos , player.rotation);
    }
    else if(Input.GetKeyDown(KeyCode.Keypad2)) {
            Instantiate(prefab[2], pos , player.rotation);
    }
}

ghost objects are usually done by instantiating the object with a ghost shader/material which follows where the mouse is. When the relevant button is pressed the object stops following the mouse point and has the shader/material changed to it’s normal shaders (diffuse or whatever). You’ll probably want to disable colliders whilst in ghost mode as well.