Skip to content

Instantly share code, notes, and snippets.

@Fraktality
Created April 2, 2020 19:19
Show Gist options
  • Save Fraktality/ad6745fd5fdbb78633152d54c2ab3100 to your computer and use it in GitHub Desktop.
Save Fraktality/ad6745fd5fdbb78633152d54c2ab3100 to your computer and use it in GitHub Desktop.
local function bbox(part)
local size = part.Size
local inv = part.CFrame:inverse()
local wx = size*inv.XVector
local wy = size*inv.YVector
local wz = size*inv.ZVector
return Vector3.new(
math.abs(wx.x) + math.abs(wx.y) + math.abs(wx.z),
math.abs(wy.x) + math.abs(wy.y) + math.abs(wy.z),
math.abs(wz.x) + math.abs(wz.y) + math.abs(wz.z)
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment