CFrame.Position.Position going on without stop

image
^

System Information: see private message

Beta Features:

Dragger QoL Improvements
Live Animation Creator
New Luau Type Solver
Next Gen Studio Preview
Reimport
User Provided Default Instances

CFrameRotationMadness.rbxl (57.4 KB)

Expected behavior

I would expect a warning preventing people from doing this

A private message is associated with this bug report

in the image you attached, is this not the expected behaviour? a cframe is composed of position and rotation data, and you can use it to store position or rotation only, or both, doing cframe.rotation just returns you a copy of the cframe without any position data (by without i just mean with position set to 0, 0, 0), with only rotation data present (but because it’s still a cframe which the engine treats as both position and rotation data combined together, regardless if one of these goes unused, it is logically possible to do .Rotation on a cframe again and again because it exists as a property of every cframe)

for example:

local rotation_only = (CFrame.new(5, 10, 7) * CFrame.Angles(0, math.rad(90), 0)).Rotation --still a cframe

print(rotation_only) -- position data would be 0, 0, 0

-- as i said, CFrame.Rotation does not return a Vector3, it returns a copy of the CFrame with no translation instead which naturally has it's own .Rotation property, as does every CFrame

hope this helped you understand why it’s possible to do it over and over again

They’re talking about how Rotation has a property of itself.

because doing CFrame.Rotation returns a CFrame, and every CFrame has that property? so is it not normal behaviour that you can keep repeating it as much as you want to? even if it’s useless it still makes sense why you can do it

This is the expected behavior.

.Rotation returns a copy of the CFrame with the position part zeroed out, not a reference to some sub-part of the existing CFrame data.

As such the redundant .Rotations aren’t actually redundant here, they each make a unique copy of the CFrame. Which if you immediately throw away the copies isn’t useful, but if you store them in a variable might be.