-
What do you want to achieve? I want to make it so when the player touches another player they go through them
-
What is the issue? I could not find any assets or plugins about it
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub. Yes
Use a local script to set canCollide to false on other player’s character models.
That wouldn’t work too well as I’m pretty sure that means the player would be able to go through parts.
A better way of doing it would be with collision groups & filtering:
Maybe, I thought the server would display the other player’s position information over what was happening locally, looking at it now it seems kinda silly. A workaround to this could be also anchoring the other players. Using collision groups seems like a more established solution though.
I use this, put it in workspace:
script.Parent = game:GetService("ServerScriptService")
local PhysService = game:GetService("PhysicsService")
local PlayerGroup = PhysService:CreateCollisionGroup("p")
PhysService:CollisionGroupSetCollidable("p","p",false)
function NoCollide(model)
for k,v in pairs (model:GetChildren()) do
if v:IsA"BasePart" then
PhysService:SetPartCollisionGroup(v,"p")
end
end
end
game:GetService("Players").PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
char:WaitForChild("HumanoidRootPart")
char:WaitForChild("Head")
char:WaitForChild("Humanoid")
wait(0.1)
NoCollide(char)
if player.Character then
NoCollide(player.Character)
end
end)
end)
Hello! Before asking, please do some research! Anyways, there is a developer hub page showing how to disable Player-Player Collisions! Link can be found here: Collisions | Documentation - Roblox Creator Hub