How do I make a group of Object tween to the same position without one interfering with another

So I’m making a fish-aquarium type game and this is what i have so far:

What im trying to do next, is make a swarm of fishes swim together in the same general direction, so I’m wondering how i can do that considering I’m using a specific point for one fish

this is the code im using btw, (in a client sided script):

local fish =
local fishRegionFol = game.Workspace.FishRegion
local region1 = fishRegionFol.Region
local rotateTIme = 0.7

local ts = game:GetService("TweenService")
local tweenInf =, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local tweenInf2 =, Enum.EasingStyle.Sine, Enum.EasingDirection.In)

function moveFish()
	local fClone = fish:Clone()
	fClone.Parent = workspace
		while wait(2) do
			local randX = math.random((region1.Position.X - region1.Size.X/2), (region1.Position.X + region1.Size.X/2))
			local randY = math.random((region1.Position.Y - region1.Size.Y/2), (region1.Position.Y + region1.Size.Y/2))
			local randZ = math.random((region1.Position.z - region1.Size.z/2), (region1.Position.z + region1.Size.z/2))
			local randPoint =, randY,randZ)
			local lookPoint = CFrame.lookAt(fClone.Position,, randY,randZ))
			ts:Create(fClone, tweenInf2, {CFrame = lookPoint}):Play()
			ts:Create(fClone, tweenInf, {Position = randPoint}):Play()



I do have some ideas in mind which may not be the most efficient ex. offsetting one fishes position to the left or right, but wont be very effective when making a large swarm.

I know this has definitely been done before in many games using a lot of math so this is why I’m making this post to ask anyone who knows how to do this efficiently

Yep you are right it’s been done before and it is known as boids.

Just found this video which links a module and the result is really cool: