I found this interesting bug or error ? Or maybe just I dont know where is problem.
I am using collision groups to make some invissible wall to prevent objects go throught that but I want Players are able to go through this wall. In my studio everything works fine but in server not. I disabled every collision but player still cannot go throught that.
I also found “noclip” group and disable this group to collide but it doesnt work.
Can somebody help me with my problem ? Thank you for every answer
I am not sure 100% what you are asking for help with, can you try wording it better or provide photos?
If you are trying to make parts collide with each other whilst others cannot, you can use the built-in Roblox tab for that.
Simply go to the Model tab then select Collision Groups. You can use this tab to change how BaseParts collide with each other, assuming you have them setup to join the collision group.
I would highly recommend having a look at Roblox’s API page for Physics Service too.
Yeah, but instead of changing CollisionGroupId, leave it how it is and try the script method.
Also note that SetPartCollisionGroup(part, name) uses two arguments. The name argument takes the collision group name in a string. Do not provide a collision group id for this part.
Collision between Players and PiranhaFence. When false I can go inside when true I cant so working fine. I leave it false, publish to roblox, play from site and I cant go iside
Yes, but it is just copied code from site above and 2 lines are commented:
local PhysicsService = game:GetService("PhysicsService")
local Players = game:GetService("Players")
local playerCollisionGroupName = "Players"
--PhysicsService:CreateCollisionGroup(playerCollisionGroupName)
--PhysicsService:CollisionGroupSetCollidable(playerCollisionGroupName, playerCollisionGroupName, false)
local previousCollisionGroups = {}
local function setCollisionGroup(object)
if object:IsA("BasePart") then
previousCollisionGroups[object] = object.CollisionGroupId
PhysicsService:SetPartCollisionGroup(object, playerCollisionGroupName)
end
end
local function setCollisionGroupRecursive(object)
setCollisionGroup(object)
for _, child in ipairs(object:GetChildren()) do
setCollisionGroupRecursive(child)
end
end
local function resetCollisionGroup(object)
local previousCollisionGroupId = previousCollisionGroups[object]
if not previousCollisionGroupId then return end
local previousCollisionGroupName = PhysicsService:GetCollisionGroupName(previousCollisionGroupId)
if not previousCollisionGroupName then return end
PhysicsService:SetPartCollisionGroup(object, previousCollisionGroupName)
previousCollisionGroups[object] = nil
end
local function onCharacterAdded(character)
setCollisionGroupRecursive(character)
character.DescendantAdded:Connect(setCollisionGroup)
character.DescendantRemoving:Connect(resetCollisionGroup)
end
local function onPlayerAdded(player)
player.CharacterAdded:Connect(onCharacterAdded)
end
Players.PlayerAdded:Connect(onPlayerAdded)
and this for wall:
local PS = game:GetService("PhysicsService")
PS:SetPartCollisionGroup(script.Parent,"PiranhaFence")
Use this to assign player’s collision group instead. (Disable the scripts you have in your current game before adding this one) Make sure you are doing this in a normal script too, not a local script
local Players = game:GetService("Players")
local PhysicsService = game:GetService("PhysicsService")
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
for _,BasePart in pairs(Character:GetDescendants()) do
if BasePart:IsA("BasePart") then
PhysicsService:SetPartCollisionGroup(BasePart, "Players")
end
end
end)
end)
And for the wall, try this:
local PhysicsService = game:GetService("PhysicsService")
PhysicsService:SetPartCollisionGroup(script.Parent, "PiranhaFence")
Let me know how it goes, if it still does not work, it may be a Roblox bug.
Did you disable the scripts that were in game before you added the new one? If you did then I don’t know what is causing problems. You might have to leave it as a Roblox bug.