DragDetector Mode switch crash with certain DragStyles and SetPermissionPolicyFunction

DragDetectors with PermissionPolicy set to Scriptable, DragStyle being either BestForDevice, TranslateLineOrPlane, or TranslatePlaneOrLine, as well as a script structured similarly below, then pressing the Mode button while dragging an object will cause a crash. This happens with both Studio and Client.

debounce = false

script.Parent:SetPermissionPolicyFunction(function()
	if debounce then
		return false
	else
		return true
	end
end)

script.Parent.DragStart:Connect(function()
	debounce = true
end)

script.Parent.DragEnd:Connect(function()
	debounce = false
end)

Studio crash:

Client crash:

Expected behavior

Any other DragStyle other than the ones that cause a crash performs regularly. Also, this just shouldn’t crash in the first place.

A private message is associated with this bug report

2 Likes

Thanks for reporting this @Stixxal

I will look into this today.

2 Likes

I can reproduce your bug.
(Note that if the PermissionPolicyFunction just always returns true, there is no crash.
So it has something to do with how your debounce logic is interacting with our ‘restart-when-modeswitch-is-pressed’ logic.)
@Stixxal can you file a bug on the devforum and post a link to that bug here?

1 Like

I can, but I’m not sure exactly why I need to create another report. Is it to have an up-to-date file that contains more information than this current report? Sorry if I’m not understanding here.

Oh, sorry. I see this IS in the bug report section, so a bug for me to track already exists in our system. It just wasn’t assigned to me yet so I missed it.

2 Likes

I’ve found the root of the problem and a fix is coming. I’ll update here when it goes live; should be the first or second week after the Thanksgiving holiday.

1 Like