You might want to try this! Put this line of code in the step event of the parent billboard for depth:
var _obj=obj_mode7_ground_infinite;
depth=point_distance(x,y,_obj.offset[0],_obj.offset[1])