RTS Formation system issue,

Hello! i am RequiemZap, so let’s get straight to the point
i was working on my RTS Game Project (solo developing)
And i was improving the current Unit/Troop System
i had an issue making a formation system
Tried Using Grid System, has multiple issues (for i loops)

Image Examples: (stolen from google)
image
image

Part Of my Code:

TroopModule.MoveTroop = function(Player, TroopTable, Position)


	for t, Troop in TroopTable  do-- Troops in The troop table
		if Troop.Data.Owner.Value ~= Player  or Troop.Data.Command.Value == true then print('Not owner') return end
		for i,Cframe in Position do	-- cframes in position table 
	
			Troop.Humanoid:MoveTo(Cframe.Position)

			task.spawn(function()
				Troop.Humanoid.MoveToFinished:Wait()			
				Attack(Troop)
			end)
		end

		--	TroopNet:Fire(Player,"ResetParts")
	end

end
``` this is the code without formation setting

anybody interested. i finished it by myself

what i did
i used a for i loop for x
and for i loop for z
(grid system)

send Mouse.Hit (client → server)
then added the vector3(x,0,z) to the mouse CFrame
some math to make it format
anybody interested in more details tell me!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.