Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

This CFrame and Vector3 are starting to really confuse me, help?

Alright, so the definition of Cframe.new(Vector3) is this: Creates a CFrame from a Vector3

Which confuses me because aren't both CFrame and Vector3 just simply the coordinates of a part? Like wouldn't that description jut be saying: Creates a position from a position Which really confuses me.

1 answer

A Vector3 is a location with x, y and z coordinates.

For example, a part has a position of (1,0,3), so you know where it is located but you have no clue about how it is rotated or oriented.

CFrames are locations with orientations. So if you wanted to set the orientation of an object, you'd have to use CFrames.

What you said about CFrame.new(Vector3) is creating a CFrame at that position with a standard rotation. If you wanted to have a part CFramed to look at another part, you would do part.Position = CFrame.new(part.Position,lookAtPart.Position)

Another difference is that when you move a part to another part's exact location with position, it will go above it so that they don't intersect, but when you do it with CFrame, they will both be in the exact same position even if they intersect.

This discussion is preserved as it was. New answers, comments, and votes are closed.