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

Parameter 1 must be BasePart in SetPartCollisionGroup?

I'm trying to set up a collision group between a door, which is a model with various parts in it, and players. How can I index/reference a BasePart within a player?

local PhysicsService = game:GetService("PhysicsService")
 
local doorGroup = "DoorGroup"
local playerGroup = "playerGroup"
 
PhysicsService:CreateCollisionGroup(doorGroup)
PhysicsService:CreateCollisionGroup(playerGroup)

local door = game.Workspace.DoorModel.Part1
local player = -- needs to reference a BasePart in a player
 
PhysicsService:SetPartCollisionGroup(door, doorGroup)
PhysicsService:SetPartCollisionGroup(player, playerGroup)

PhysicsService:CollisionGroupSetCollidable(doorGroup, playerGroup, false)

1 answer

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