HI all
i'm writing a code for simple vehicle movement without using physics (@xxxGuitar: I'm still using Newton for the other one, messing with the tire friction and getting better results now

this is a different level) and i'm stuck at a point where i need to climb a slope..
I've made the car body to stop around 10 quants in the air so i can have space for the tires and also bcoz its the only way i could think of to detect slope using trace..
here's the Z movement code..
//Code start
if(!disable_trace)
{
//Z movement
vec_set(temp,my.x);
temp.z -= 4000;
trace_mode = ignore_me+ignore_sprites+IGNORE_MODELS;//+USE_BOX;
car_elevation = trace(my.x,temp);
if(car_elevation>70) {flag_bounce=1;}
if(car_elevation>25)
{ my.z-=fall_counter;
if(fall_counter<4) {fall_counter+=time;}
}//increase Z vel with time..
if(flag_bounce==1 && car_elevation<25)
{rebound_z(); fall_counter = 0; flag_bounce=0;}
if(car_elevation<25) {fall_counter = 0;}
}
//here rebound_z is a function that disables trace, 'bounces' the car and then enables trace again.
if(car_elevation<15) {my.z -= (car_elevation)*0.5*time;}
//climbing the slope.. 15 bcoz the trace value decreases when near a slope. The watch says 22 but it goes to 22 and below even on straight ground sometimes..
vec_to_angle(norm,normal.x); //detect floor normals
norm[0]-=180;
diffpan = my.pan - norm[0];
if((90-norm[1])>5) //on a slope
{
my.tilt = (90-norm[1])*cos(diffpan);
my.roll = (norm[1]-90)*sin(diffpan);
}
if((90-norm[1])<5) //on flat ground
{ if (my.tilt>0) {my.tilt-=4*time;}
if (my.tilt<0) {my.tilt+=4*time;}
my.roll = 0;
}
if(car_elevation<5) {my.z+=25;} //a bug in my code, not sure how to fix it, trace value suddenly drops while traveling on straight ground and i have to elevate the car to 10 quants again.
//Code end
When the car is on a slope, the tilt and roll is fine and goes according to the slope. The main problem is getting on the slope in the first place

Here are the problems
1. It stays at the base of the slope for a while before climbing it, if it climbs at all

2. Sometimes it doesn't climb after being stuck for a while.. at that time if i turn the car and face away from the slope, it shoots forward like a rocket! even though i didn't code for such a high velocity on normal running.
3. Sometimes it falls through the slope
If you've read until here, thanks a lot for ur patience

and thanks in advance for any help.