I have this script which tampers with the collision groups of an enemy when it gets added into the workspace. But for some odd reason, I can still collide with their HumanoidRootPart. This is what I do.
for i, object in ipairs(newMob:GetDescendants()) do
if object:IsA("BasePart") then
object.CollisionGroup = "Enemy"
end
end
The function that it’s inside is working, I can see the collision groups changing with the enemy, and I know that it is the HumanoidRootPart because when I get rid of it, I can walk completely through.
Are you sure both players and the enemies have all their parts set to the Enemy collisiongroup and that the collision group is set to not collide with each others
I’m pretty sure, but this is my script right now, just see if anything’s wrong.
local plrs = game:GetService("Players")
plrs.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
for i, object in ipairs(char:GetDescendants()) do
if object:IsA("BasePart") then
object.CollisionGroup = "Player"
object.CanQuery = false
end
end
end)
end)
all of them can only collide with default.
could it be because my character uses r15 and a default bacon, and they’re meshparts, because its never happened to me using a different avatar?
Edit: even though it says its being assigned, they’re not. Only the HumanoidRootPart is being assigned.