Touched event and anchored parts problem

So basically i was working with a counter, it is a script inside a no collision part that counts how many parts called “cellb” are touching it, it only works when parts are not anchored, this means, and i know, that “touched” event only works with blocks that have motion, in my case i want to keep those parts in their place but without anchoring them.

I noticed that in roblox classic games they don’t use anchor function and the blocks/parts don’t move and i could use that but i don’t know how, if anyone has a solution or an alternative for my problem it would be really useful.

Part of the code


    if otherPart.Name == "celdab" then
        touchingCells[otherPart] = true 
    end
end

local function countTouchingCells()
    local count = 0
    for part, _ in pairs(touchingCells) do
        if part and part:IsDescendantOf(game) then
            count = count + 1
        else
            touchingCells[part] = nil
        end
    end
    return count
end

detector.Touched:Connect(onPartTouched)
2 Likes