You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I’m trying to Disable both Player and Player Collisions and Player and NPC Collisions. -
What is the issue? Include screenshots / videos if possible!
For some reason you can still collide with the NPC. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried Debugging the script with print statements, and the bodyparts are getting put to their respective Collision Groups. I know they work since when I disable the Collisions with Default, they fall through.
--Script inside of ServerScriptService
local Players = game:GetService("Players")
local BubblxNPC = game.Workspace["BubblxYT NPC"]
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
for i, bodypart in pairs(char:GetDescendants()) do
if bodypart:IsA("BasePart") then
bodypart.CollisionGroup = "Players"
print("Bodypart: " .. bodypart.Name .. " has been added to the collisiongroup " .. bodypart.CollisionGroup)
end
end
end)
end)
for i, bodypart in pairs(BubblxNPC:GetDescendants()) do
if bodypart:IsA("BasePart") then
bodypart.CollisionGroup = "NPCS"
print("Bodypart: " .. bodypart.Name .. " has been added to the collisiongroup " .. bodypart.CollisionGroup)
end
end
Any Help would be nice!