By continuing the line of thought from Nate Eldredge's comment you can handle finitely many separated parts of the space by a distance having values at most one and exactly one between points in different connected components. However, a possible counter-example (I did not yet check the details) should follow by continuing this to countably many separated parts that accumulate. For instance:
Take $$X = [-1,0] \cup \{\frac1n\,:\,n \in \mathbb N\}$$ with the induced topology from $\mathbb R$. Each isolated point $\frac1n$ has to have positive measure. Since they accumulate to $0$ you cannot put a distance on $X$ separating them from the interval $[-1,0]$. This should force a discontinuity for a suitable $r>0$ when $x$ travels along $[-1,0]$.