Group of Characters following player, like Pikmin

I’m trying to make a Pikmin stlye demo in Unity. I’m trying to get all the Pikmin to follow behind the player. Ideally I’m looking to make something like this:

Right now I just have a point in space behind the player that they all move towards. They start out fine (Imgur: The magic of the Internet) but slowly form a sort of star pattern (Imgur: The magic of the Internet). This makes sense because they are all trying to get to the very center and cant all fit.

So my thought was to have them stop moving if they are within a certain distance of the point. However they just get to that distance and stop moving closer (obviously), just forming a ring around the point (Imgur: The magic of the Internet).

My question is what would be a good way to go about making them move in a group following the player (Similar to the video).

Anyone have any ideas?

You could have them adopt different formations based on how many of them there are, and simply move that formation as a whole. Look to RTS games for some example of this.

1 Like

I think you want to google “flocking behavior.” Though actually, here’s a more specific search… almost anything on the first page or two there will be useful to you.

1 Like