6. Let the complex number $z$ satisfy $|z|=1$, such that the equation $z x^{2}+2 \bar{z} x+2=0$ has real roots, then the sum of such complex numbers $z$ is $\qquad$

Translate the above text into English, please retain the original text's line breaks and format, and output the translation result directly.
Answer: $-\frac{3}{2}$.
Solution: Let $z=a+b \mathrm{i}\left(a, b \in \mathbf{R}, a^{2}+b^{2}=1\right)$.
Rewrite the original equation as $(a+b \mathrm{i}) x^{2}+2(a-b \mathrm{i}) x+2=0$, and separate the real and imaginary parts to get
$$
\begin{array}{c}
a x^{2}+2 a x+2=0, \\
b x^{2}-2 b x=0 .
\end{array}
$$

If $b=0$, then $a^{2}=1$, but when $a=1$, (1) has no real solutions, so $a=-1$. In this case, there exist real numbers $x=-1 \pm \sqrt{3}$ that satisfy (1) and (2), hence $z=-1$ satisfies the condition.

If $b \neq 0$, then from (2) we know $x \in\{0,2\}$, but clearly $x=0$ does not satisfy (1), so it must be $x=2$. Substituting $x=2$ into (1) gives $a=-\frac{1}{4}$, and thus $b= \pm \frac{\sqrt{15}}{4}$, leading to $z=\frac{-1 \pm \sqrt{15} \mathrm{i}}{4}$.
In summary, the sum of all complex numbers $z$ that satisfy the condition is $-1+\frac{-1+\sqrt{15} \mathrm{i}}{4}+\frac{-1-\sqrt{15} \mathrm{i}}{4}=-\frac{3}{2}$.