// Update is called once per frame void Update() { if (player == null) { player = GameObject.FindGameObjectWithTag("Player").GetComponent <AttachCol>(); } if (Input.GetMouseButtonDown(0)) { player.Detatch(); } }
void Start() { player = GameObject.FindGameObjectWithTag("Player").GetComponent <AttachCol>(); }