Is taking projective closure a functor?

For an affine variety $X\subset \mathbb{A}^n$, we can associate it with $\overline{X}$, which is the closure of $X$ in $\mathbb{P}^n$.

Does $\overline{X}$ depend on the choice of embedding $X\subset\mathbb{A}^n
$? Suppose given $f\colon X\subset\mathbb{A}^n\to Y\subset\mathbb{A}^n$,does it induce morphism $\overline{f}\colon \overline{X}\to \overline{Y}$?

Solutions Collecting From Web of "Is taking projective closure a functor?"

Yes, the projective closure depends on the choice of embedding. For example, the closure of $\{ x^3 – y = 0 \} \subset \mathbb{A}^2$ in $\mathbb{P}^2$ is singular, but it can also be embedded in a non-singular projective curve.

Functoriality also fails in general: the morphism $\{ x^3 – y = 0 \} \subset \mathbb{A}^2 \to \mathbb{A}^1$ given by $(x, y) \mapsto x$ cannot be extended to a morphism between the projective closures.