Let $Y$ be a projective scheme. The naive definition of a Hilbert scheme of subschemes $X$ of $Y$ would require us to projectively embed $Y$, then ask that $X$ have a fixed Hilbert polynomial $p$.
However, this space is usually disconnected. Cheap example: $Y$ is two points, $p=1$, and the Hilbert scheme is $Y$ itself. More expensive example: $Y = {\mathbb P}^1 \times {\mathbb P}^1$ in the Segre embedding, $p(d) = d+1$. Then $X$ is a line from one of the two rulings, so this naive Hilbert scheme is a disjoint union of two $\mathbb P^1$s.
If $F\to X$ is a flat family of subschemes of $Y$, i.e. $F \subseteq Y\times X$, then the class in $K_\bullet(Y)$ of a fiber -is- isn't locally constant on $X$. (EDIT: Oops! Jason Starr suggests a related invariant that is, in a comment.) So the proper definition of "the Hilbert scheme of subschemes of $Y$" should include "with fixed $K$-class $p \in K_\bullet(Y)$". (If $Y$ is projective space, the $K$-class is exactly the same data as the Hilbert polynomial.) This finer invariant suffices to break apart the disconnected spaces in the examples above.
I presume that, in general, fixing the $K$-class is not enough to get a connected Hilbert scheme. (Certainly Hartshorne's proof of connectivity in the case $Y={\mathbb P}^n$ does not go through, as it uses a big group action.)
Is there an easy example of a projective scheme $Y$ and two subschemes $X_1,X_2$ defining the same class in $K$-homology of $Y$, but there is no flat connected family of subschemes of $Y$ including $X_1,X_2$ as fibers?
$K_\ast(X) \to \text{Hom}_{\mathbb{Z}}(K^\ast(X),\mathbb{Z})$
induced by the pairing$K^\ast(X) \times K_\ast(X) \to \mathbb{Z}$
sending$([\mathcal{E}],[\mathcal{F}])$
to$\chi(X,\mathcal{E}\otimes_{\mathcal{O}_X}\mathcal{F})$
. This is the sort of thing that Martin Olsson and I used in our work to try to pin down the numerical invariants of a quasi-compact, open and closed piece of the Hilbert scheme. $\endgroup$