var wheelcon;
function cam{
camera.x = my.x + fcos(my.pan,-200);
camera.y = my.y + fsin(my.pan,-200);
camera.z = my.z + 50;
camera.pan = my.pan;
}
function initchassis{
phent_settype(my,ph_rigid,ph_box);
ph_setgravity(vector(0,0,-300));
phent_setmass(my,100,ph_box);
phent_setgroup(my,2);
phent_setfriction(my,20);
phent_setelasticity(my,20,20);
phent_setdamping(my,0,0);
}
function initwheel{
while(player == null){wait(1);}
phent_settype(my,ph_rigid,ph_sphere);
phent_setmass(my,1,ph_sphere);
phent_setgroup(my,2);
phent_setfriction(my,20);
phent_setelasticity(my,0,20);
phent_setdamping(my,30,30);
wheelcon = phcon_add(ph_wheel,player,my);
phcon_setparams1(wheelcon,my.x,vector(0,0,0),vector(0,0,0));
phcon_setparams2(wheelcon,vector(0,0,0),nullvector,nullvector);
}
action wheel{
initwheel();
while(1){
wait(1);
}
}
action user{
player = my;
initchassis();
while(1){
cam();
wait(1);
}
}
function main{
video_switch(7,0,1);
level_load("tester.wmb");
}
I finally got the physics engine working, but every attempt at making the car accelerate has failed, can anyone tell me how to do it?