NPCs Follow Player Like In Eathbound or Omori?

Godot Version

Godot 4

Question

NOTE: I’m a begginer and I barley know how to code

I’m trying to make a game mechanic simular to eathbound’s, two characters walk behind the player while animating in a top down pixel art setting.

The player is reffered to as the character “Hope” and in the game, two characters “Kevin” and “Alex” follow her along the map.

I tried using nav agent which generates a new path to follow the player in, it works but it’s buggy and sometimes the other characters colide and it’s just not what I want.

The main issues I’m fasing:

I want the player to be able to go “into” the other characters if they want to go back or up in the same possition while the other characters stop moving(and stop animating) until they can follow Hope again in the correct order, since when I do that with navagent it just makes the characters walk in front or next to hope instead of behind her.

Here’s a video of what I mean if it helps (Here I also show the code and stuff)((i just realised it wont allow me but ill do once the account isnt new))

1 Like

Try looking into kidscancode website and in there i think there is a tutorial for pets that follow the layer in the AI section. Try looking there. I think the code is going to be very similar but idk for sure, never used it myself.

1 Like

I looked into it, couldn’t really find anything simular to what I’m looking for but tysm, the channel looks helpful

Did you check this: Pet Following :: Godot 4 Recipes

I think its similar to what you want. Or just try looking around in the website. Its really helpful. Good luck for your project!

I tried it, though it makes it so the characters are on the side or behind the player, which isnt something i want, i want it so it follows the player according to their direction