I have experienced this exact issue. Strangely, locally setting a part’s collision off or something similar replicates to server-sided objects somewhat as if the game was in Experimental Mode.
Here is a video of a local script setting the baseplate’s collision to false, while my character is anchored:
robloxapp-20211124-2244599.wmv (1.2 MB)
I don’t know why this happens, possibly a server Network Ownership problem considering it targets closer objects as displayed in the video. However, the solution to this problem is by using a server script to set the collision groups of players and the walls:
local PhysicsService = game:GetService("PhysicsService")
PhysicsService:CreateCollisionGroup("Player")
PhysicsService:CreateCollisionGroup("Wall")
for _, Wall in pairs(workspace:GetChildren()) do
if Wall.Name == "MonMur" then
PhysicsService:SetPartCollisionGroup(Wall,"Wall")
end
end
PhysicsService:CollisionGroupSetCollidable("Player","Wall",false)
game:GetService("Players").PlayerAdded:Connect(function(Player)
local CurrentConnection
Player.CharacterAdded:Connect(function(Char)
if CurrentConnection then
CurrentConnection:Disconnect()
end
for _, Part in pairs(Char:GetChildren()) do
if Part:IsA("BasePart") then
PhysicsService:SetPartCollisionGroup(Part,"Player")
end
end
CurrentConnection = Char.DescendantAdded:Connect(function(Part)
if Part:IsA("BasePart") then
PhysicsService:SetPartCollisionGroup(Part,"Player")
end
end)
end)
end)
The walls MUST have CanCollide set to true in order for collision groups to function. Otherwise, collision groups are ignored.
Why not just assign the NPCs to the "Player" collision group, and use PhysicsService:CollisionGroupSetCollidable("Player","Wall",true)?
Other than the fact that parts ignore collision groups when CanCollide is false, from the research I have done, it seems as though Roblox made CollisionGroupSetCollidable() to check the booleans like this: If true, treat it as default collisions do. If false, the parts within both groups don’t collide with each other. So basically, using true is useless in this method. In my opinion, very poor and inconvenient design.
I also noticed you have cars that you may need to drive out of the barrier. To allow other parts to pass through you should either add some sort of value to each part you wish to pass through the barrier (such as an Attribute), or add those parts to a table. In this case I just used Attributes, but it’s easy to write the code in either way. So you can add the code below to the previous code for setting player collisions.
for _, Part in pairs(workspace:GetDescendants()) do
if Part:IsA("BasePart") and Part:GetAttribute("WallCollideOff") then
PhysicsService:SetPartCollisionGroup(Part,"Player")
end
end
workspace.DescendantAdded:Connect(function(Part)
if Part:IsA("BasePart") and Part:GetAttribute("WallCollideOff") then
PhysicsService:SetPartCollisionGroup(Part,"Player")
end
end)
Unfortunately with Collision Groups, Roblox has kind of forced this to be a long process of elimination to leave the NPCs out in this case. But at least it’s functional.