Mouse Sensivity Problem

Hello Everybody,
I have a problem with Mouse Sensivity. I have a code as that

var Prefab   : GameObject ;
var Prefab2  : GameObject ;
var Prefab3  : GameObject ;


function Update () {
    if (Input.GetMouseButton(0)) {
        var ray: Ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        var hit: RaycastHit;

        if (Physics.Raycast(ray, hit)) {
            Instantiate(Prefab, hit.point, Quaternion.identity);
        } 
    }
}

I placing an item when i cliked the “mouse 0” but my problem about mouse sensivity when i clicked the “mouse 0” placed a lot of the same object in the scene.

How can i place only one object scene ?

Regards

if (Input.GetMouseButton(0))

will repeat every frame.

if (Input.GetKeyDown("Fire1"))

should do the same thing without repeating every frame :smile:

Thank you! Problem is solved!