Hey,
i'm having trouble with preventing my ai (zombies) from colliding with other objects (pickups, walls and obj_player)
i just started with gamemaker so i really dont know what to look for, ill post my codes below. If you need to see other codes please ask.
Thanks in advance
Zombie step:
//Statesscript_execute(state);//Collisionsif hspeed!=0if !place_free(x+hspeed,y){if hspeed>0 move_contact_solid(0,hspeed)if hspeed<0 move_contact_solid(180,-hspeed)hspeed=0}if vspeed!=0if !place_free(x+hspeed,y+vspeed){if vspeed>0 move_contact_solid(270,vspeed)if vspeed<0 move_contact_solid(90,-vspeed)vspeed=0}
//Move to directionimage_angle = direction - 90;
Script enemy follow
///scr_enemy_followvar dis = point_distance(x,y,obj_player.x,obj_player.y);if (!collision_line(x,y,obj_player.x,obj_player.y,obj_wall,1,1)) alerted = true;if (alerted = true) && (dis <= aggroRange) && (dis > attackRange){mp_potential_step(obj_player.x,obj_player.y,enemySpeed,true);sprite_index = spr_zombie1_aggro;image_speed = 0.16;}else if (alerted = true) && (dis <= attackRange){speed = 0;state = scr_enemy_attack}else{state = scr_enemy_static;alerted = falsesprite_index = spr_zombie1_idle;}