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

[SOLVED] Make a part not collide with players using physics service?

Asked by 4 years ago
Edited 4 years ago

Imagine this scenario: I'm trying to make a part that players can walk through but it has to unanchored, if I just set can collide to false it falls to the void. I then learned that I can use the PhysicsService service to make a collision group between the players and the part. Only issue is I cant get it working. Anyone know how I can do that?

Current code:

01local PhysicsService = game:GetService("PhysicsService")
02local Players = game:GetService("Players")
03PhysicsService:CreateCollisionGroup("Parts")
04PhysicsService:CreateCollisionGroup("Players")
05PhysicsService:CollisionGroupSetCollidable("Parts","Players",false) --I had this set to true it should've been false
06 
07game.Workspace.ChildAdded:Connect(function(c)
08 
09    if c.Name == "Hoverboard" then
10 
11        local Collision = c:WaitForChild("Collision")
12        PhysicsService:SetPartCollisionGroup(Collision, "Parts")
13 
14    end
15 
View all 34 lines...

The code is supposed making it so that part that is making the Hoverboard 'float' cannot collide with players but Its not working.

0
Show us what you have so far so we may determine where you went wrong. Ziffixture 6913 — 4y
0
I added my code. Sorry it took so long :/ wwwaylon09 113 — 4y

Answer this question