do a trace down from the entity, if the trace doesnt hit anything, move X quants down. If trace hits something, stop moving down (maybe even smooth the position to the target.z). That's being theoretically, i'll write a solution if i have time when i get back home