I want to make a vehicle drive on the terrain with hills. Here's the code which I use to place the vehicle on the ground:
var trace_to_ground;
action move(){
...
trace_to_ground = c_trace(my.x, vector(my.x,my.y,my.z-1000), IGNORE_ME|IGNORE_PASSENTS|IGNORE_PASSABLE|IGNORE_SPRITES|USE_BOX);
if(trace_to_ground>1){my.z = -275;}
...
But this code does not keep the vehicle on the surface.... vehicle appears on the ground but if I want to drive it down the hill it starts floating in the air, since the hill went down.... Then I decided to pace this code into a loop, so I added while(1)...wait(1), but now the same , the vehicle keeps moving along z=my.z - 275; and even goes through terrain if the hill goes up. I understand why it happens..... I wanted to apply physics but I had problems with scripting it... So, is it possible to keep the vehicle on the ground, no matter what terrain looks like, whether it has hills/mountains/plains/etc, without using physics?