hio, when i try to use movement codes "c_move" it doesnt work with physics it doesnt work (myplayer is guard model)

Code:
action myplayer()
{


myplayer = me;

    ph_setgravity (vector(0, 0, -386)); 
    phent_settype (myplayer, PH_RIGID, PH_BOX); 
    phent_setmass (myplayer, 3, PH_BOX); 
    phent_setfriction (myplayer, 80);
    phent_setdamping (myplayer, 40, 40); 


    while (1)
    {

    	if(key_w)
    	{
    	ent_animate(myplayer, "walk", walk_percentage, ANM_CYCLE);
 walk_percentage += 3 * time_step; 
 c_move (my, vector(15*time_step, 0, 0), nullvector, GLIDE);
    
        }
        
        wait(1);
}

	
}


and if i try following codes, when i try move, my objects falls down, cant stay on foot;

Code:
action myplayer()
{

myplayer = me;

    ph_setgravity (vector(0, 0, -386)); 
    phent_settype (myplayer, PH_RIGID, PH_BOX); 
    phent_setmass (myplayer, 3, PH_BOX); 
    phent_setfriction (myplayer, 80);
    phent_setdamping (myplayer, 40, 40); 


   
    while (1)
    {
    	if(key_w)
    	{

        myplayer_speed.x = 5 ;
        myplayer_speed.y = 0 ;
        myplayer_speed.z = 0; 
        phent_addvelcentral (myplayer, myplayer_speed); 
        }
        wait(1);
}



what kind of movement codes i need and physics works on human model?

Last edited by justgamefreak; 08/19/08 20:05.