Well, so what your saying is that the player part works fine until you add this:


Code:
 function Phy_debug_throw() {
     var flyvec[3];
     vec_set(earthgravity, vector(0,0, -386));
     
          while(1) {
                  
               if(mouse_left) {
     	            you = ent_create("pfeil.mdl",camera.pos,NULL);
     	            c_setminmax(you); 
     	            vec_set(you.pan,camera.pan); 
    	            ph_setgravity(earthgravity);
     	            phent_settype(you,PH_RIGID,PH_BOX);
     	            phent_setmass(you,2,PH_BOX);
     	            phent_setelasticity(you,5,100);
     	            phent_setfriction(you,60);
     	            phent_setdamping(you,60,80);
     	            flyvec[0] = 1;
     	            flyvec[1] = 0;
     	            flyvec[2] = 0;
     	            vec_rotate(flyvec[0],camera.pan);
     	            vec_scale(flyvec[0],300000);
     	            phent_addcentralforce(you,flyvec[0]);
     	            wait(-0.2);
     	       } //END IF 
          } //END WHILE
     } //END FUNCTION 


But this works just fine by itself:

Code:
 function camera_move(){
     
     while(player){
     
          camera.pan += 0.5 * ang(player.pan - camera.pan);
          vec_set(camera.x,player.x);
          camera.z += 60; ///+ sin(total_ticks * 10);
          mouse_mode = 0;
          wait(1); 
     } //END WHILE
} //END FUNCTION

Action player_move(){
     var reldist[3];
     var absdist[3];
     var input_vec[3];
     var Vz = 0;
     var jump_able = 1;
     my.invisible = on;
     player = me;
     camera_move();
     
          while(me){
               vec_set(reldist.x,nullvector);
               input_vec.x = (key_w - key_s) * time * 30;
               input_vec.y = (key_d - key_a) * time * -18;
               my.pan -= 30 * mouse_force.x * time;
               camera.pan = my.pan;
               camera.tilt = min(max(ang(camera.tilt + 30 * mouse_force.y * time),-60),60);
               Vz += (Vz == 0) * 100 * key_space * jump_able;

                    if(Vz > 0){
                         jump_able = 0;
                    } //END IF
               
               Vz -= (Vz > 0);
               c_move(me,input_vec,nullvector,GLIDE);
               c_move(me,nullvector,vector(0,0,(Vz - 35) * time),0);

                    if(trace_hit){
                         jump_able = 1;
                    } //END IF
         
               wait(1);
          } //END WHILE 
     } //END ACTION 



Last edited by Volund; 08/22/08 22:15. Reason: cleaner code