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

Parameter 1 must be BasePart in SetPartCollisionGroup?

Asked by
Hypgnosis 186
5 years ago

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

Log in to vote
0
Answered by 3 years ago

Because player is not a basepart

Ad

Answer this question