This depends on how you are actually creating the character. A piece of code would help us.
To get the distance just use a c_trace and / or vec_dist.