private void Update() { if (Input.GetMouseButton(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit) && hit.collider.CompareTag("Cell")) { Cell cell = hit.collider.GetComponent <Cell>(); if (movementController.MoveToCell(cell)) { currentCoordinates.SetCoordinates(cell.cellProperties.X, cell.cellProperties.Z); cell.ActivateEvent(); } } } }