Hi ,guys.
I want to add physics system to a character to make it move as a real person and use some 'ph_/phent_' commands in the lite-c script. But when running the code the model could do nothing but perform the 'walk' animation in the original place. The code is like this:
action walking_guard()
{
guard = my;
guard.material = mat_model;
phent_settype(guard,PH_RIGID,PH_SPHERE);
phent_setmass(guard,3,PH_SPHERE);
phent_setfriction(guard,80);
phent_setelasticity(guard,40,40);
phent_setdamping(guard,30,5);
ph_setgravity(vector(0,0,-386));
while(1)
{
if(key_w == 0 && key_s == 0 && key_e == 0)
{
ent_animate(my,"stand",walk_percentage, ANM_CYCLE);
walk_percentage += 3 * time_step;
}
else
{
if(key_e == 0)
{
ent_animate(my,"walk",walk_percentage, ANM_CYCLE);
walk_percentage += 5 * time_step;
}
}
}
}
Many thanks!!