Include orientation in CFrame formatting

CFrames now display both position and rotation components to properly
show changes when objects are rotated, not just translated.

Format: (X, Y, Z), (rotX°, rotY°, rotZ°)
This commit is contained in:
Andrew Vu 2025-11-08 03:40:14 -05:00
parent 29113c4f74
commit 8f8c19b845

View file

@ -29,7 +29,10 @@ local function DisplayValue(props)
text = string.format("{%s, %s}, {%s, %s}", fmtNum(x.Scale), fmtNum(x.Offset), fmtNum(y.Scale), fmtNum(y.Offset)) text = string.format("{%s, %s}, {%s, %s}", fmtNum(x.Scale), fmtNum(x.Offset), fmtNum(y.Scale), fmtNum(y.Offset))
elseif t == "CFrame" then elseif t == "CFrame" then
local p = props.value.Position local p = props.value.Position
text = string.format("(%s, %s, %s)", fmtNum(p.X), fmtNum(p.Y), fmtNum(p.Z)) local rx, ry, rz = props.value:ToOrientation()
text = string.format("(%s, %s, %s), (%s°, %s°, %s°)",
fmtNum(p.X), fmtNum(p.Y), fmtNum(p.Z),
fmtNum(math.deg(rx)), fmtNum(math.deg(ry)), fmtNum(math.deg(rz)))
elseif t == "NumberRange" then elseif t == "NumberRange" then
text = string.format("[%s, %s]", fmtNum(props.value.Min), fmtNum(props.value.Max)) text = string.format("[%s, %s]", fmtNum(props.value.Min), fmtNum(props.value.Max))
end end