I want to create a platoon of Bots

Hello, I’m currently trying to make a platoon of bots in formation. Essentially, a bunch of soldiers in a formation. If I turn right, I want the platoon to turn right. How would I go about doing this?

3 Likes

you could make X amount of rigs get their primarypart.CFrame to follow yours :joy:

Depends on how you want the platoon to turn. Do you want them to all rotate to the right in place, or turn in a sort of L shape? The first case is simple: just have them move to the right and they’ll all turn. The second case is less simple: you’d have to track which bots have moved far enough to begin the turn and have them turn in order as they meet the required distance to turn. Ideally, they’d all begin turning on the diagonal line that separates the L into two equal parts:

image

(poor diagram, but the red lines are bots walking straight and the blue lines are bots that have turned right - the green line indicates where every bot should end up before they turn to maintain the shape)

To be fair, I don’t really care if they make organized turns. Essentially I want a row of bots that will follow me.

1 Like

Have you heard of Boids? This may be overkill, but it’d be an interesting approach to this problem.

It’s an algorithm made to mimic the natural flocking behavior of birds and fish. You could repurpose this algorithm to give your platoon a “flocking” effect around you - they would, of course, turn as a natural consequence of the behavior of the algorithm, since they would want to surround you. There’s a lot of settings you could tweak (specifically, alignment and separation) to give the platoon the behavior you desire.

I kind of just want to make something similar to Lurac_Case’s bot commander. Mostly just the marching.