Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

PhysicsService GetCollisionGroups not working?

local groups = game:GetService('PhysicsService'):GetCollisionGroups();

for _, v in ipairs(groups) do
	local id, mask, name = unpack(v);
	print(id, mask, name);
end

prints: nil nil nil x4

Before running this, I've already created 3 collision groups. I also know they were successfully created because PhysicsService:CollisionGroupContainsPart() works

1 answer

✓ Accepted answer

Shouldn't you unpack the table instead of the object inside the table?

Like

local id, mask, name = unpack(groups)

edit :

local groups = game:GetService('PhysicsService'):GetCollisionGroups();

local id, mask, name = unpack(groups)
print(id, mask, name)

This discussion is preserved as it was. New answers, comments, and votes are closed.