have you tried vec_for_min like in the tutorial for a shooter?
if you cant move anymore set my.z+2 before moving so after it it will be set to ground again and you wont see it.