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.

2 comments

0

Show us what you have so far so we may determine where you went wrong.

0

I added my code. Sorry it took so long :/