private void FixedUpdate() { if (isMoving) { transform.position = Vector3.MoveTowards(gameObject.transform.position, targetPosition, stepValue); if (gameObject.transform.position == targetPosition) { isMoving = false; int[] newCoord = (FindCoord(gameObject.transform.position)); master.DeskChange(x, y, newCoord); x = newCoord[0]; y = newCoord[1]; master.SwapTurn(); } } }