I’m trying to create a system where you have a group of npcs that follow the players mouse but for some reason its not orientating correctly. I want them to stay in a formation like this behind the front one.
the problem is that when they move on a different axis they go like this.
localscript
local Plr = game.Players.LocalPlayer
local Mouse = Plr:GetMouse()
Mouse.TargetFilter = game.Workspace.MTF
game:GetService(“RunService”).RenderStepped:Connect(function()
game.ReplicatedStorage.MoveMTF:FireServer(Mouse.Hit.Position)
end)
serverscript
game.ReplicatedStorage.MoveMTF.OnServerEvent:Connect(function(Plr, MousePosition)
local function GroupRoam()
local MTF1 = game.Workspace.MTF.MTF1
MTF1.Humanoid:MoveTo(MousePosition)
local MTF2 = game.Workspace.MTF.MTF2
MTF2.Humanoid:MoveTo(MousePosition + Vector3.new(-2.5,0,2.5))
local MTF3 = game.Workspace.MTF.MTF3
MTF3.Humanoid:MoveTo(MousePosition + Vector3.new(2.5,0,2.5))
local MTF4 = game.Workspace.MTF.MTF4
MTF4.Humanoid:MoveTo(MousePosition + Vector3.new(-2.5,0,5))
local MTF5 = game.Workspace.MTF.MTF5
MTF5.Humanoid:MoveTo(MousePosition + Vector3.new(2.5,0,5))
endGroupRoam()
end)