Hi, I’m doing some tests with Collision Groups and I’ve run into an annoying problem.
In my game I need precise collisions between players and to do that I created a collision box for each player part. This is the script:
local playerCollisionGroupName = "PlayerTestColl"
local playerCollisionGroupName2 = "AnimColl"
local playerCollisionGroupName3 = "CollisionOFF"
function CreateCollisions(char)
wait(1)
local Array = char:GetChildren()
for i,v in Array do
if v:IsA("BasePart") then
if (v.Name == "UpperTorso" or v.Name == "LowerTorso" or v.Name == "Head") then
v.CollisionGroup = playerCollisionGroupName2
else
v.CollisionGroup = playerCollisionGroupName
end
local part = Instance.new("Part")
part.Name = "CollisionPart"..v.Name
part.Size = v.Size
part.Position = v.Position
part.Parent = v
part.Transparency = 0.5
part.Color = Color3.new(1, 0, 0)
part.CanCollide = true
part.Anchored = false
part.CollisionGroup = playerCollisionGroupName3
local weld = Instance.new("WeldConstraint")
weld.Parent = v
weld.Name = "CollisionWeld"..v.Name
weld.Part0 = v
weld.Part1 = part
end
end
end;
game.Players.PlayerAdded:Connect(function(player)
repeat wait(0.5)
print("WAIT")
until player.Character
CreateCollisions(player.Character)
player.CharacterAdded:Connect(CreateCollisions)
end)
As you can see in the video below, if the player’s red parts and the blue part have the same collision group, the player cannot walk smoothly on the blue part. When player enable collisions in settings, the red parts collision group is set to “CollisionON”. The blue part in the video is anchored, has collisions enabled, and its collision group is “CollisionON”.
These are my Collision Groups (ignore “AnimColl”):
Any idea how to fix this issue?