my = obj; ???

I don't understand this line, why do you fill a pointer with a vector? I'm not really up to date with the latest engine commands but I don't think that that's possible. I would do it by simply using vec_dist (obj,you.x) and not using my at all.