Last active
September 24, 2025 20:18
-
-
Save daily3014/1ce2b2ae772add0ff1ce5a9998c19842 to your computer and use it in GitHub Desktop.
GetExtentsSize for Parts
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
| -- Original from https://devforum.roblox.com/t/getextentssize-of-one-part-without-model/404945/7 | |
| -- 300% faster than original | |
| --!native | |
| --!optimize 2 | |
| --!strict | |
| local function GetPartExtentsSize(Part: BasePart): Vector3 | |
| local Size: Vector3 = Part.Size | |
| local SX: number, SY: number, SZ: number = Size.X, Size.Y, Size.Z | |
| local R00: number, R01: number, R02: number, | |
| R10: number, R11: number, R12: number, | |
| R20: number, R21: number, R22: number = select(4, Part.CFrame:GetComponents()) | |
| local R0 = Vector3.new(math.abs(R00), math.abs(R10), math.abs(R20)) * SX | |
| local R1 = Vector3.new(math.abs(R01), math.abs(R11), math.abs(R21)) * SY | |
| local R2 = Vector3.new(math.abs(R02), math.abs(R12), math.abs(R22)) * SZ | |
| return R0 + R1 + R2 | |
| end | |
| -- Example | |
| local Part = workspace.Baseplate | |
| local Size: Vector3 = GetPartExtentsSize(Part) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where are the unit tests daily?