Collison Group Player

I am trying to make a ball that cannot collide with the player (to prevent them from riding it) however I cannot use the simple route by making it cancollide off locally because it is parented server to local. I am trying to make a collision grouping for this but it doesn’t work (I don’t know how to do collision groups lol)

game.Players.PlayerAdded:Connect(function(player)
	wait(3)
	player:LoadCharacter()
	local character = player.Character
	local physics = game:GetService('PhysicsService')
	physics:CreateCollisionGroup("Object")
	physics:SetPartCollisionGroup(game.Workspace.SoccerBall, "Object")
	physics:SetPartCollisionGroup(character, "Object")
	physics:CollisionGroupSetCollidable("Object", "Object", false)
end)
1 Like

This may work:

game.Players.PlayerAdded:Connect(function(player)
	wait(3)
	player:LoadCharacter()
	local character = player.Character
	local physics = game:GetService('PhysicsService')
	physics:CreateCollisionGroup("Object")
	physics:SetPartCollisionGroup(game.Workspace.SoccerBall, "Object")
	for i,v in pairs(player.Character:GetDescendants()) do
       if v:IsA("BasePart") then
         physics:SetPartCollisionGroup(v, "Object")
       end
    end
	physics:CollisionGroupSetCollidable("Object", "Object", false)
end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.