This is being very difficult to understand / implement.

I´m using this code I found somewhere in the forums, and changed a few things to my convenience, but nothing that could break its functionallity :

______________________________________________________________

function simple_car()
{
vecGravity.x = 0;
vecGravity.y = 0;
vecGravity.z = -9.81;

pX_setgravity (vecGravity);

ENTITY* car = ent_create("F3.mdl",vector(6700,25500,5),NULL);

pXent_settype(car,PH_RIGID,PH_CONVEX);
pXent_setmass(car,1);

car.material = mtl_envmirror;
car.shadow = ON;

pXent_setmassoffset(car,vector(NULL,NULL,-3),vector(1,0.1,1)); //moves the center of mass 10 quants down.

ENTITY* BLwheel = ent_create("tyre.mdl",vector(car.x - 60,car.y - 20,car.z + 8 ),mass);
ENTITY* BRwheel = ent_create("tyre.mdl",vector(car.x - 60,car.y + 20,car.z + 8),mass);
ENTITY* FLwheel = ent_create("tyre.mdl",vector(car.x + 46 ,car.y - 25,car.z + 8),mass);
ENTITY* FRwheel = ent_create("tyre.mdl",vector(car.x + 46,car.y + 25,car.z + 8),mass);

pXcon_add ( PH_WHEEL, FLwheel, car, 0 );
pXcon_add ( PH_WHEEL, FRwheel, car, 0 );
pXcon_add ( PH_WHEEL, BLwheel, car, 0 );
pXcon_add ( PH_WHEEL, BRwheel, car, 0 );

pXcon_setparams2(BRwheel, NULL,vecBRwheel, vecBRwheel2);
pXcon_setparams2(BLwheel, NULL,vecBLwheel, vecBLwheel2);
pXcon_setparams2(FRwheel, NULL,vecFRwheel, vecFRwheel2);
pXcon_setparams2(FLwheel, NULL,vecFLwheel, vecFLwheel2);

while(1)
{

if(key_a)
{
speed += (1 * time_step);
}
else
{
if ( speed > 0
{
speed -= (1 * time_step);
}
}

if(key_z)
{
speed -= (1 * time_step);
}

if(key_n)
{
tyreAngle -= ( 2 * time_step) ;
}
else
{
if (tyreAngle < 0)
{
tyreAngle += ( 1 * time_step) ;
}
}


if(key_m)
{
tyreAngle +=( 2 * time_step);
}
else
{
if (tyreAngle > 0)
{
tyreAngle -= ( 1 * time_step) ;
}
}


pXcon_setwheel (FLwheel,tyreAngle,0,0);
pXcon_setwheel (FRwheel,tyreAngle,0,0); // steer to the right
//pXcon_setwheel (BLwheel,0,speed,0);
//pXcon_setwheel (BRwheel,0,speed,0);

var max_speed = 300;
var ang_force = speed * 100;

//pXcon_setmotor(car,vector(-ang_force, max_speed, 0), nullvector);
//pXcon_setmotor(car,vector(-ang_force, max_speed, 0), nullvector);

pXent_addvelcentral(car,vector(((speed) * time_step),0,0));
pXent_addvelcentral(car,vector(0,0,-10));

pXent_addvelcentral(FLwheel,vector(0,0,-50));
pXent_addvelcentral(FRwheel,vector(0,0,-50));
pXent_addvelcentral(BLwheel,vector((speed),0,0));
pXent_addvelcentral(BRwheel,vector((speed),0,0));

var temp[1];
var camTilt;
var camPan;
var cam_dist=0;
var CamFromWheel = 10;
var CamFromGround = 5;
var x_cam;

camera.arc = 72;
camera.clip_near = 0;
camera.clip_far = 100000;
camTilt = car.tilt ;
camPan = car.pan - 180 ;
cam_dist = clamp(0,CamFromWheel,20);
camera.x = ((((car.x))+ cos(camPan)*(cam_dist*cos(camTilt)))) + x_cam ;
camera.y = ((car.y + sin(camPan)*((cam_dist*cos(camTilt)))));
camera.z = car.z + 20 ;
vec_set(temp,car.x);
vec_sub(temp,camera.x);
vec_to_angle(camera.pan,temp);
camera.tilt = -3;
wait(1);
}
}


______________________________________________________________

but... an interesting thing is happening :

When the car is pointint to positive x vector, and I´m pressing the "a" key, it accelerates ok. then I turn 180 degrees in the track, and the orientation of the car is the opposite.

Then the car slows very fast, and it start to go in reverse !

It´s very disappointing, I know I´m very nooby in the PhisX thing, maybe also in coding, but this is so... weird...

Ipm really interested in learning and maybe applying what Ventilator said, but, if I can´t even manage to understand well this code above...

Well, any help or tips will be HIGHLY appreciated.

Cya