This is my collision group script:
local ps = game:GetService("PhysicsService")
local ocean = "ocean"
local boat = "boat"
local chars = "chars"
local border = "border"
ps:CreateCollisionGroup(border)
ps:CreateCollisionGroup(ocean)
ps:CreateCollisionGroup(boat)
ps:CreateCollisionGroup(chars)
for _, v in next, game.Workspace.ocean:getChildren() do
ps:SetPartCollisionGroup(v, ocean)
end
for _, v in next, game.Workspace.border:getChildren() do
ps:SetPartCollisionGroup(v, border)
end
for _, v in next, game.Workspace.boat1:GetDescendants() do
if v:IsA("BasePart") then
ps:SetPartCollisionGroup(v, ocean)
end
end
ps:CollisionGroupSetCollidable(ocean, boat, false)
game.Players.PlayerAdded:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
for _, v in next, char:GetDescendants() do
if v:IsA("BasePart") or v:IsA("Accesory") then
ps:SetPartCollisionGroup(v, chars)
ps:CollisionGroupSetCollidable(chars, ocean, false)
ps:CollisionGroupSetCollidable(border, chars, false)
print("e")
end
end
print("person joined")
end)
the ocean doesn’t collide with the player when I do this (as expected): ps:CollisionGroupSetCollidable(chars, ocean, false) but when I do it to border: ps:CollisionGroupSetCollidable(border, chars, false) the player still collides with it. Any idea causing the problem, why the character still could collide with the border even though I turned the collisions to false?