What do you want to achieve? So basically my water part has CanColloide false, but i don’t want it goes inside another part with CanColloide true, but the player can still go inside the part without the cancolloide. How do i do it?
I tried to make a script using collision groups, but it isn’t working (it’s a serverscript)
local PhysicsService = game:GetService("PhysicsService")
local drum = "Drum"
local water = "Water"
PhysicsService:RegisterCollisionGroup(water)
PhysicsService:RegisterCollisionGroup(drum)
local waterPart = workspace.Water
waterPart.CollisionGroup = water
local drumPart = workspace.WashingMashineClassic["Constarin Cestello"].Union
drumPart.CollisionGroup = drum
PhysicsService:CollisionGroupSetCollidable(water, drum, false)
local PhysicsService = game:GetService("PhysicsService")
local water = "Water"
local chara = "Char"
PhysicsService:RegisterCollisionGroup(chara)
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
plr.Team = game.Teams.Lobby
for i,part in pairs(char:GetChildren()) do
if part:IsA("BasePart") then
part.CollisionGroup = chara
end
end
end)
end)
PhysicsService:RegisterCollisionGroup(water)
local waterPart = workspace.Water
waterPart.CollisionGroup = water
PhysicsService:CollisionGroupSetCollidable(chara, water, false)
Ty for the answer
I treid to make this script, but it doesn’t work. What’s the error?
local PhysicsService = game:GetService("PhysicsService")
local water = "Water"
local chara = "Char"
PhysicsService:RegisterCollisionGroup(chara)
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
plr.Team = game.Teams.Lobby
for i,part in pairs(char:GetDescendants()) do
if part:IsA("BasePart") then
part.CollisionGroup = chara
end
end
end)
end)
PhysicsService:RegisterCollisionGroup(water)
local waterPart = workspace.Water
waterPart.CollisionGroup = water
PhysicsService:CollisionGroupSetCollidable(chara, water, false)
Check if the parts are actually getting the collision group while playtesting, from properties I mean, and make sure it’s not giving you any error. It may be because right after character is added character parts aren’t completely loaded. Try using CharacterAppearanceLoaded instead of CharacterAdded.