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 3 years ago
Edited 3 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:


local PhysicsService = game:GetService("PhysicsService") local Players = game:GetService("Players") PhysicsService:CreateCollisionGroup("Parts") PhysicsService:CreateCollisionGroup("Players") PhysicsService:CollisionGroupSetCollidable("Parts","Players",false) --I had this set to true it should've been false game.Workspace.ChildAdded:Connect(function(c) if c.Name == "Hoverboard" then local Collision = c:WaitForChild("Collision") PhysicsService:SetPartCollisionGroup(Collision, "Parts") end end) Players.PlayerAdded:Connect(function(p) p.CharacterAdded:Connect(function(c) for i,v in pairs(c:GetChildren()) do if v:IsA("Part") or v:IsA("MeshPart") then PhysicsService:SetPartCollisionGroup(v, "Players") end end end) end)

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 — 3y
0
I added my code. Sorry it took so long :/ wwwaylon09 113 — 3y

Answer this question