That's the thing; I'm a little confused as to where I should be tracing from to account for both cases of having a model placed in the ground or above the ground. I have tried tracing from my.x to a point below the character and I have tried tracing from the lowest vertex of the model to the ground both without getting the correct solution. My latest attempt was the following code:

Code:
VECTOR vec_min;
VECTOR vec_max;
wait(1);
c_setminmax(me);
vec_for_min(vec_min, me);
vec_for_max(vec_max, me);
result = c_trace(vec_max, vector(vec_max.x,vec_max.y,vec_max.z-1000), IGNORE_ME | IGNORE_MODELS | IGNORE_PASSABLE | USE_BOX | IGNORE_SPRITES); // trace from the origin to the floor and store the result
my.z -= target.z;
my.z += (vec_max.z-vec_min.z);


1. traced from the top vertex to a position below
2. lower the distance traced from the top vertex to the position below (c_trace returns the distance)
3. then add the height of the entity (max vertex - min vertex)

In theory, the above solution should work for models placed in the ground but it doesn't seem very efficient and it also doesn't work. tongue Any tips or better ways to approach this case?

Thanks for your replies!