Thanks Thunder I'll do that.
I have another ?
I have the code for the enemy to follow the player, recently I made a mummy and I want him to follow after me it all works fine with my mummy_follow_player code, except that when they follow me they pass through the unhollowed floors.
I want the Mummy to glide and not do that, I have tried changing it myself but would not be able to do it, can anyone who knows help me figure out.
this is my code.
Quote:
var reaction_distance = 900;
function get_shot
{
if(event_type==event_impact) // entity was hit by a bullet
{
sleep(1); //wait 4 seconds
my.invisible=on; //turn invisible
my.passable=on; //turn passable
myscore=myscore+10;
}
}
action mummyfollowplayer
{
while(me)//while I exist in the level
{
//check for the player
if(player)
{
if (my.health==0)
{
my.enable_entity=on; //make the enemy sensible to getting hit with c_move
my.event=get_shot; // run this function when hit
}
wait(1);
vec_set(temp,my.x);
trace_mode = IGNORE_ME;
while (1)
{
my.enable_impact=on;
my.event=lev_2_event;
break;
}
//turn to the player
vec_set(temp.x,player.x);
vec_sub(temp.x,my.x);
vec_to_angle(my.pan,temp.x);
if(vec_dist(my.x,player.x) < reaction_distance)
{
ent_move(vector(7,0,0),vector(2,2,1));
}
}
wait(1);
}
}
I tried changing the code in red to trace_mode= ignore_me+ ignore_passable+ glide;
and used Use_box etc but it doesn't seem to work.
These are pictures of what happens when the mummy follows me.


In the second picture the mummy is following me and walks through the floor.