No gameobject instance again in update

Hello, I need handle instantiating of GameObject by ,MarkInst" and ,CanMarkInst" bool, but when I hit mouse button 0 these bools go false but it still can instantiate when I am hitting mouse button 0… :confused: Please help :slight_smile:

    using UnityEngine;
    using System.Collections;
    
    public class Smazat : MonoBehaviour {
    	public Camera cam;
    
    	public GameObject Marker;
    
    	public bool MarkInst = true;
    	public bool CanMarkInst = true;
    
    	public float x;
    	public float y;
    	public float z;
    
    	void Update() {
    		if (Input.GetMouseButton(0))
    		{
    			RaycastHit info;
    			if (Physics.Raycast(cam.ScreenPointToRay(Input.mousePosition), out info))
    			{
    				x = info.point.x;
    				z = info.point.z;
    				y = info.point.y;
    			}
    
    			if(MarkInst == true && CanMarkInst == true)
    			{
    				Instantiate(Marker, new Vector3(x,y,z), Quaternion.Euler(1,1,1));
    				MarkInst = false;
    				CanMarkInst = false;
    			}
    		}
    		if (Input.GetMouseButtonUp (0)) {
    			x = 0;
    			z = 0;
    			y = 0;
    		}
    	}
}

I want make unit choosing marker in strategy game and I need on click make only one ,Marker", but everytime when I hold mouse button 0 it making infinite of ,Markers"… It doesnt show any errors…