Last active
January 31, 2025 09:21
-
-
Save ryanlua/405db1aebe72ddfeaee41b76f39de190 to your computer and use it in GitHub Desktop.
Disables shadows for small parts to improve performance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local ChangeHistoryService = game:GetService("ChangeHistoryService") | |
| local minSize = Vector3.new(5, 5, 5) | |
| local recording = ChangeHistoryService:TryBeginRecording("Disable CastShadow") | |
| for _, descendant in pairs(game:GetDescendants()) do | |
| if descendant:IsA("MeshPart") or descendant:IsA("Part") or descendant:IsA("UnionOperation") then | |
| if descendant.Size.X < minSize.X and descendant.Size.Y < minSize.Y and descendant.Size.Z < minSize.Z then | |
| descendant.CastShadow = false | |
| end | |
| 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