Wrong error with PhysicsService:SetPartCollisionGroup

Minimal repro:

game:GetService("PhysicsService"):SetPartCollisionGroup(nil, "Default")
-- Error: Parameter 2 must be BasePart in SetPartCollisionGroup.

It’s supposed to be parameter 1.

1 Like

If you’re wondering why it’s printing this, in lua the colon is flavor speak for calling a function with self as the first argument.

For example, you can also call this method with the following code:

PhysicsService.SetPartCollisionGroup(PhysicsService, nil, "Default") --note the '.' instead of ':'

In other words, you’ve been calling all of your methods with an invisible argument this entire time when using a colon :slight_smile:

2 Likes