Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

PhysicsService GetCollisionGroups not working?

Asked by 13 days ago
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

Log in to vote
2
Answered by 13 days ago
Edited 13 days ago

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)
Ad

Answer this question