Hello, i have an Pathfinding ai that gets stuck on objects alot so i made a folder with the blocks the ai gets stuck on, then made it all with CanCollide off, i put a script in the StarterPlayerScripts in the player that makes everything in the folder Collideable, this worked on my old world but i made a new one and it no longer works, is there another way to do this or fix the script?
for _, child in ipairs(game.Workspace["Part 1"].BlockList:GetChildren()) do
if child:IsA("Part") then
child.CanCollide = true
end
end
instead of Child.Collide i did print(Child.name) and it gets everything in the folder but wont work.
It’s just I feel that it would simply be easier to set the blacklist to a CollisionGroup that allows the ai to go threw but then have a localscript that sets the player to a preexisting CollisionGroup that does the opposite.
I don’t think it’ll work, the original world had the script where it Dident check if it was a block or anything and it worked fine but I changed it to check if it was a part in the new worked or see if it would work and it doesn’t
Videos a little zoomed in but as u see on server side it’s collide off but when I join the game I’m able to collide with it, the script works fine but won’t in the other game no idea why