I've been trying to get an NPC, in my case a zombie, to follow me in my game of course to no avail. I'm using the following script for my character to move
if(keyboard_check(vk_left)){
sprite_index = spr_player;
x -= 4;
}
if(keyboard_check(vk_right)){
sprite_index = spr_player;
x+= 4;
}
if(keyboard_check(vk_down)){
sprite_index = spr_player;
y += 4;
}
The name of the NPC object is (obj_zombie).