I have been developing a boss fight in my game. Every part within the boss uses a collision group called “NPCs” that cannot interact with the collision group the player is in, which is called “Players”. I have it so that different collision groups can touch other collision groups, just not collide. In the area before the boss fight, the player has to parkour around parts that cause them to rag doll to their death. When the player reaches the boss fight, I have realized that during a specific touched event, the player says (using a print statement through trial and error) that they touched either the void or one of the rag dolling parts (randomly, there appears to be no pattern). When the touch event is not connected, nothing happens, but when the touch event is connected, even with no code inside of it, the player says that they touched one of the parts or the void. I told the script to make the part the player touched glow, and for the player part that touched it to be duplicated and anchored so that I could see where the interaction was taking place. When it occurred, a part over 100 studs away lit up, and the player’s humanoid root part was cloned exactly where it was supposed to be, inside the player and over 100 studs away from the part it “touched”. This is the touched event that disabling causes this strange interaction to not occur:
local rightBladeConnection = noob.RightAxe.RightHitBox.Touched:Connect(function(hit)
end
This is the code for the rag doll parts:
for _, RagdollPart in ipairs(game.Workspace:GetDescendants()) do
if RagdollPart.Name == "RagdollPart" then
task.spawn(function()
local damageProcessor = require(game.ReplicatedStorage:WaitForChild("DamageProcessor"))
RagdollPart.Touched:Connect(function(hit)
local hitPlayer = game.Players:GetPlayerFromCharacter(hit.Parent)
if hitPlayer and not hitPlayer:GetAttribute("Ragdolling") then
print(hit)
hit.Anchored = true
hitPlayer:SetAttribute("Ragdolling", true)
hitPlayer:SetAttribute("CanRun", false)
local dies = RagdollPart:GetAttribute("Dies")
print(RagdollPart.CFrame)
RagdollPart.Transparency = 0
RagdollPart.Material = Enum.Material.Neon
local partclone = hit:Clone()
partclone.Anchored = true
partclone.Parent = workspace
task.spawn(function()
game.ReplicatedStorage.Remotes.Ragdoll:Fire(hit.Parent, dies, RagdollPart:GetAttribute("RagdollTime"))
end)
task.wait(RagdollPart:GetAttribute("RagdollTime") or 2.9)
if not dies then
local damage = damageProcessor.processDamage(hitPlayer, nil, RagdollPart:GetAttribute("Damage"), nil)
hit.Parent:FindFirstChild("Humanoid"):TakeDamage(damage)
end
hitPlayer:SetAttribute("Ragdolling", false)
hitPlayer:SetAttribute("CanRun", true)
end
end)
end)
end
end
Additionally, the player does not appear to move at all when he supposedly touches one of the parts/void.