Setting a part’s CollisionGroup to a collision group that has not been created in Studio has inconsistent behavior on mobile compared to PC.
In Studio and live game, the collision group collides with everything, while on mobile it does NOT collide with anything.
Code sample used:
local Players = game:GetService("Players")
local function onDescendantAdded(descendant)
-- Set collision group for any part descendant
if descendant:IsA("BasePart") then
descendant.CollisionGroup = "Characters"
end
end
local function onCharacterAdded(character)
-- Process existing and new descendants for physics setup
for _, descendant in character:GetDescendants() do
onDescendantAdded(descendant)
end
character.DescendantAdded:Connect(onDescendantAdded)
end
Players.PlayerAdded:Connect(function(player)
-- Detect when the player's character is added
player.CharacterAdded:Connect(onCharacterAdded)
end)
(I forgot to actually create the Characters collision group)
PC specs:
- Ryzen 7 5800x3D
- GTX 1660 Ti
- 16gb RAM
Mobile: (Not mine, unable to provide more info, but seems to also happen for other users)
- Amazon Fire HD 10
Expected behavior
I would expect the behavior to be the same between device types.
An additional warning or error for unregistered collision groups would be nice too.