Skip to content

Instantly share code, notes, and snippets.

@ryanlua
Last active April 16, 2024 02:30
Show Gist options
  • Select an option

  • Save ryanlua/8af8a6928fd2f368be7533354879f0a5 to your computer and use it in GitHub Desktop.

Select an option

Save ryanlua/8af8a6928fd2f368be7533354879f0a5 to your computer and use it in GitHub Desktop.
Removes all CanTouch and CanQuery collision events for better performance
local ChangeHistoryService = game:GetService("ChangeHistoryService")
local recording = ChangeHistoryService:TryBeginRecording("Disable CanTouch and CanQuery on BaseParts")
for _, descendant in pairs(game:GetDescendants()) do
if descendant:IsA("BasePart") then
descendant.CanTouch = false
descendant.CanQuery = false
end
end
ChangeHistoryService:FinishRecording(recording, Enum.FinishRecordingOperation.Commit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment