Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

PhysicsService GetCollisionGroups not working?

Asked by 3 years 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 3 years ago
Edited 3 years 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