Hi guys,

I just upgraded to the commercial edition 6.31.4 (and am trying to make physics work (I couldn't make it work in the trial; was it disabled?). I've got a script which I think should create an entity then send that entity off into the sunset. For some reason this isn't working. Here's the script, what have I done wrong?
Code:
var video_mode = 8;	 // screen size 1024x768
var video_depth = 32; // 32 bit colour D3D mode

string lvlStr = <junk.wmb>;
string witchStr = <cbabe.mdl>;

var witchPos[3] = 100, 0, 20;
var witchForceVec[3] = 0, 0, 200;

entity* witch;

function physFunction() {
witch = me;
phent_settype(witch, ph_rigid, ph_box);
ph_setgravity(nullvector);
phent_setmass(witch, 10, PH_BOX);
phent_setdamping (witch, 0, 0);
while(1) {
if(key_a == 1) {
phent_addcentralforce(witch, witchForceVec);
}
wait(1);
}
phent_settype(witch, 0, 0);
}

function main() {
level_load(lvlStr);
wait(1);
ent_create(witchStr, witchPos, physFunction);
}




Steve I'm on a diet of black coffee and prozac buttered toast.