how do i make it so that a player cant collide with an unanchored part? I know I have to use collision groups, but I don’t know how to use them.
1 Like
They’re pretty simple, you just have to make a no collision constraint in every part of the character and have Part0 as the part and Part1 as the player; Part0 and Part1 can be switched around and you can modify the script to make it just one player instead of all of them by replacing the variable g with the character and attaching :GetChildren() to it. I made a script like this a while ago so here it is.
-- Put this in the ServerScriptService or wherever it works for you.
while true do
walls = {game.Workspace.Wall, game.Workspace.Wall2} -- These parts are examples, put the walls you want in the table.
c = game.Players:GetChildren()
for i = 1, #c do
if c[i].Character ~= nil and c[i].ClassName == "Player" then
g = c[i].Character:GetChildren()
for h = 1, #g do
if g[h]:IsA("BasePart") then
for x,l in ipairs(walls) do
if g[h]:FindFirstChildOfClass("NoCollisionConstraint") and g[h]:FindFirstChildOfClass("NoCollisionConstraint").Part1 == l then return end -- if they already have a "NoCollisionConstraint" for this wall.
local NoCollision = Instance.new("NoCollisionConstraint")
NoCollision.Part0 = g[h]
NoCollision.Part1 = l
NoCollision.Parent = g[h]
end
end
end
end
end
wait(0.1)
end
1 Like