So basically my npc gets cloned with a simple loop it has pathfinder script inside of it and when it spawns it should walk to the checkpoint which it does but then I throw in obstacles that its supposed to get obstructed by but doesn’t, I have set custom collision groups for npcs AAnd the npc obstacles and yet it completely ignores that EVEN the default gets ignored and the npc just walks through the wall even if the said wall should not be passable.
cloning script
local dummy = game.ServerStorage:FindFirstChild("Dummy")
--local pf = game.Workspace:FindFirstChild("pathfinder")
local point = script.Parent
local hasspawned = false
while true do
wait(1)
if hasspawned == false then
hasspawned = true
npc = dummy:Clone()
npc.Parent = game.Workspace
nhrp = npc:FindFirstChild("HumanoidRootPart")
nhrp.CFrame = CFrame.new(point.Position)
for i, v in pairs(npc:GetChildren()) do
if v:IsA("BasePart") then
v:SetNetworkOwner(nil)
end
end
wait(1)
npc.pathfinder.CanMove.Value = true
--ai = pf:Clone()
--ai.Parent = npc
--ai.Disabled = false
end
end
and for the pathfinder well I didn’t stray too far away from the one in Roblox docs. Worst part is that it works when I test it with run testing and yet when I press play testing something messes up and the npc becomes a ghost that just walks a path ignoring all collidables.
Help would be appreciated!