Hey all,

I'm having an issue with an enemy entitiy, I'm trying to give them gravity. Basically I'm trying to make it so that his z makes sure it traces to the floor. but it doesn't seem to work. Here's my code: is there a better way to do this?


I appreciate any help you can provide.


action dummy
{
var distance_traced;
var movement_speed;

temp.z -= 4000; // set temp.z 5000 quants below player's origin
distance_to_ground = c_trace (my.x, temp.x, ignore_me | use_box);
movement_speed.z = - (distance_to_ground - 10); // 17 = experimental value
movement_speed.z = max (-35 * time, movement_speed.z); // 35 = falling speed

}