S
ShortyBishop
Guest
Currently, I'm trying to have an NPC follow my current player character but am having difficulty implementing it. My code seems sound, but when I test it, the NPC simply stands still (but responds to other actions, such as implementing the text bubble that appears above their head).
This code is all in the OBJfriend object- the NPC I'm trying to get to follow my OBJplayer.
Create
(Following is normally set to false but for this, I simply set it to true, a different object sets this to true. Even when running the code with true, it does not work.)
Step
EDIT: I'd like to include that the style I'm using is top-down, and not side-scroller.
Thanks to whomever can answer this question! It feels excruciatingly simple but I can't quite put my finger on it.
This code is all in the OBJfriend object- the NPC I'm trying to get to follow my OBJplayer.
Create
Code:
image_speed = 0;
walkSpeed = 3.5;
following = true;
Step
Code:
if (following = true) and (distance_to_object(OBJplayer) > 10)
{
move_towards_point(OBJplayer.x, OBJplayer.y, walkSpeed);
}
EDIT: I'd like to include that the style I'm using is top-down, and not side-scroller.
Thanks to whomever can answer this question! It feels excruciatingly simple but I can't quite put my finger on it.
Last edited by a moderator: