Whats the difference between CFrame and .Position + .Rotatinon

I’m very curious about the difference between CFrame and .Position + .Rotation. There is no difference between them as far as I know. The only difference I know is that CFrame has different features such as LookVector. What other important differences are there? Also, as I said, what would be the problem if we used .Positon + .Rotation instead of CFrame?

local part1 = workspace.Part1
local part2 = workspace.Part2

part1.Position = part2.Positoin
part1.Rotation = part2.Rotation

--Vs

part1.CFrame = part2.CFrame

1 Like

CFrames just give you more information on the part.

CFrame has X,Y, Z, R00, R01, R02, R10, R11, R12, R20, R21, and R22.

RightVector tells you which way the X of the part is facing
R00 is the X component of the RightVector
R01 is the Y component of the RightVector
R02 is the Z component of the RightVector

UpVector tells you which way the top of the part is facing
R10 is the X component of the UpVector
R11 is the Y component of the UpVector
R12 is the Z component of the UpVector

ZVector tells you which way the Z of the part is facing
R20 is the X component of the ZVector
R21 is the Y component of the ZVector
R22 is the Z component of the ZVector

Say we have a part at 0,0,0 with no rotation and we printed the CFrame:

0 0 0 1 0 0 0 1 0 0 0 1

This is just the position, rightvector, upvector, and zvector printed together

Position = (0,0,0) 
RightVector = (1,0,0) 
UpVector = (0,1,0) 
ZVector = (0,0,1)

Now lets say, we printed that parts position and rotation:

0,0,0 -- Position
0,0,0 -- Rotation

It doesn’t actually tell us which way is up, which way is down, and which way is left and right!

Rotation is more what angle off of perfect 90 degrees.
Where as CFrame tells you exactly which direction each side is facing and the position

hope that helps.

2 Likes

One important difference is if you are moving a model, the welds will break (not update) when you use .Position.

1 Like

First of all, thank you very much for your respond. But I don’t fully understand the others except Position. Can you explain them visually when you have time? Or is there a tutorial about this?

1 Like

Ah yes, that’s another thing I’m curious about. How can I move a model in the most accurate way? I only know one method :MoveTo, but I guess it can’t pass through walls.

I also know SetPrimaryPartCFrame

:SetPrimaryPartCFrame() is depracated. Therefore, abandon this method of moving models.

Instead, use the function :PivotTo(). It does the same as the depracated function, but it also works despite the model having a PrimaryPart or not.
If the model does have a PrimaryPart, it moves the model’s PrimaryPart to the specified CFrame.
If the model doesn’t have a PrimaryPart, it will take the centerpoint of the model and move it to the specified CFrame.


To reply to the topic’s question, inherently there is no difference. the .CFrame holds the same information as the .Position and the .Rotation, only it simplifies it and combines the values of those two different data types and instead makes it a single type, using only three values. This is explained in @zbav’s post above.

2 Likes

the quality will improve once it uploads fully, sorry its unedited lol.

2 Likes

Thanks for your answers. I understood the issue. It’s a little more complicated than I thought, but I’ll get used to how it’s used over time. Thank you for your time and for the video you sent.

TLDR: CFrame gives which way each side of a part is facing in a x,y,z. rotation doesn’t make sure to mark as solution if u understand.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.