Part loses ClickDetector interaction when CFramed

When there is a ClickDetector within a part that is joined to another part that is manipulated by CFrame, there is this buggy behaviour that prevents the ClickDetector from operating on the part clicked.

The ClickDetector part on the door, visually, is at the right iteration of the cframe, but, the cframe is actually lagged by an iteration, causing it to clip into what would be the door, and cause a situation similar to those had when dealing with latency (the player character is actually ahead of where the character is rendered to another player) I do not know whether or not this counts as an engine bug or not, but as far as I’m aware this is replicable so it may indeed be something to do with the engine calculating things.

I was using this to create a Da Hood themed door system, but I’ve noticed this weird behaviour when testing, the images are as follows:

The hierarchy of my ClickDetector parts, as well as what they are in the workspace:

The result of clicking the part, and the bug:
https://i.gyazo.com/30708e251137ed2ec998cec10ac06502.mp4

The downloadable file version: BrokenDoor.rbxl (29.2 KB)

1 Like

To fix it, write this in the script where you change the CFrame:

if script.Parent:FindFirstChildOfClass("ClickDetector") then
      
else
local cd = Instance.new("ClickDetector")
cd.Parent = script.Parent

cd.MouseClick:Connect(function()

-- code
end

You can function that every time the original click detector is clicked.

That’s a bug alright. Weird one too. After the door opens, the handle part isn’t even selectable with Studio’s mover tools–so invisible to raycasts like it’s not there at all.

That said, it’s not recommended to animate with server-side CFraming. This isn’t the only sort of thing that can go wrong. The door will never animate smoothly either. Consider using either a hinge constraint and align orientation, or animating by setting the target angles of a Motor6D. These will animate smoothly and will be less prone to having players end up embedded in the door or flung.

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up here when we have an update for you.

2 Likes

I am in the process of checking over bug reports and following up on some bugs that haven’t received any activity in a while.
Is this issue still occurring or can you confirm that this bug has been resolved?