Ad
Log in to vote
1

Collision Filtering: How can I let a collision group uncollidable with itself?

Asked by 9 days ago

This script is inside a part

--SERVICES
local PhysicsService = game:GetService('PhysicsService')

--VARIABLES
local Part = script.Parent

--CREATE COLLISION
local PartGroup = "PartGroup"

PhysicsService:CreateCollisionGroup(PartGroup)

1 answer

Log in to vote
1
Answered by
sickings 641
9 days ago

You can only create 'PartGroup' once. If the group already exists, the output would return a error.

Create a separate script that creates collision groups:

--CREATE COLLISION
local PhysicsService = game:GetService('PhysicsService')
local PartGroup = "PartGroup"

PhysicsService:CreateCollisionGroup(PartGroup)

PhysicsService:CollisionGroupSetCollidable(PartGroup, PartGroup, false) -- sets the group uncollidable with itself

Part script:

--SERVICES
local PhysicsService = game:GetService('PhysicsService')

--VARIABLES
local Part = script.Parent

PhysicsService:SetPartCollisionGroup(Part, 'PartGroup') -- requires a part and the name of the collision group
0
it worked thanks awesomeipod 203 — 9d
0
np sickings 641 — 9d
Ad

Answer this question