// Update is called once per frame void Update() { GameObject buttonObject = GameObject.FindGameObjectWithTag("Button"); ButtonScript button = buttonObject.GetComponent <ButtonScript>(); if (Input.GetAxisRaw("Submit") >= 0.5f) { button.TaskOnClick(); } }