hi i made a script which creates/clones 10 dummys and they do some stuffs that i wrote.
the problem is, they collide on eachother, ive already set all their bodyparts to uncollideable but they still get collide. i did some reseach about that and ended up with collisions filtering, and i dont know how to use it for this type of stuffs.
heres the script if needed ?
local players = game:GetService("Players")
local runService = game:GetService("RunService")
local pathfindingService = game:GetService("PathfindingService")
local serverStorage = game:GetService("ServerStorage")
local physicsService = game:GetService("PhysicsService")
local dummy = serverStorage.Dummy:Clone()
local dummyHumanoid = dummy.Humanoid
local dummyHRP = dummy.HumanoidRootPart
local player= script.Parent
local playerHRP = player.HumanoidRootPart
local followPart = workspace:WaitForChild("followPart", 5)
local tpDebounce = false
for i = 1, 10 do --line where creates/clones dummys
local clonedDummy = serverStorage.Dummy:Clone()
local clonedDummyHRP = clonedDummy.HumanoidRootPart
clonedDummy.Parent = workspace
clonedDummyHRP.CFrame = playerHRP.CFrame * CFrame.new(0,-5,0)
end
for i, v in pairs(workspace:GetChildren("Dummy")) do
if v.Name == "Dummy" then
local function followPartFunction()
local path = pathfindingService:CreatePath()
local movingToPos = followPart.Position
local computedPath = path:ComputeAsync(v.HumanoidRootPart.Position, movingToPos)
return path
end
if workspace:WaitForChild("followPart") then
runService.Stepped:Connect(function()
followPartFunction()
local path = followPartFunction()
for _, waypoint in pairs(path:GetWaypoints()) do
v.Humanoid:MoveTo(waypoint.Position)
end
end)
end
end
end