when theres a character the humanoidrootpart’s CanCollide property is on all the time. i tried making a loop so it would turn it off but that doesn’t work. does anyone know how to do that?
Are you just trying to make it so other players can’t collide with eachother?
If so:
local PS = game:GetService("PhysicsService")
local Players = game:GetService("Players")
PS:RegisterCollisionGroup("Player")
PS:CollisionGroupSetCollidable("Player", "Player", false)
local function assignPlayerCollisionGroup(char:Model?)
char:WaitForChild("HumanoidRootPart")
char:WaitForChild("Head")
char:WaitForChild("Humanoid")
for i, v:Instance in pairs(char:GetDescendants()) do
if v:IsA("BasePart") then
v.CollisionGroup = "Player"
end
end
end
Players.PlayerAdded:Connect(function(plr)
plr.CharacterAppearanceLoaded:Connect(function(char)
assignPlayerCollisionGroup(char)
end)
end)
I’m trying to make an npc not collide with the player.
You shouldve read what he said, its about this too:
use Collisiongroups;
Like the other replies have mentioned, you can use collision groups for this purpose. BenSBk’s open-source script still works but is probably using out of date collision group API. The existing replies to this post should solve your problem using the new Roblox methods.
i did put it into a different collisiongroup and disabled them from colliding with each other but that didn’t work. i just decided to use humanoid changestate to make him noclip so its fine now
elaborate and mark it as a solution then
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.