Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
8

Whats the difference between CFrame and Vector3? [closed]

Asked by 5 years ago

I dont get it they both move parts but i dont get why they are called different names

6
Vector3 is a 3 dimensional brick and cframe is position and size AnotherPerson_999 28 — 5y
0
Great question, despite being very short. Upvote this, people. User#24403 69 — 5y

Locked by User#24403

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

4 answers

Log in to vote
5
Answered by 5 years ago

CFrames or Coordinate Frame and are technically 4 by 4 matrixes and has more properties, like changing rotation by look vector, Euler's' angles, quaternions; they are more suited for changing the values in the 3D environment.

CFrames can deal with the world and local space, (Vector3 - CFrame) isn't possible but (CFrame - Vector3) is.

Vector3 has functions for "vector calculation", like getting the magnitude, the cross product, dot scalar, can check if a vector3 is close to another. Moving parts with vector3 doesn't allow clipping, meaning that if you were to change the position/rotation of a part already being taken by another, it would move itself on top of that. Setting two parts' position to the same location guarantees that one part will be on top of each other

0
This. Tuaz7 30 — 5y
Ad
Log in to vote
2
Answered by
Tuaz7 30
5 years ago

Vector3.new() is mostly for Positions, whereas CFrame is a part's orientation and position within a game space.

Think like, if you take a Part0's CFrame and set it to Part1's CFrame, Part0 will have the same Orientation and Position to Part1, but if you set Part0.Position to Part1.Position it will only account for Position and not orientation.

If you have anymore questions, post a comment.

Part0.Position = Part1.Position --accounts for Position and not orientation!
Part0.CFrame = Part1.CFrame --Accounts for position AND orientation!
0
if i were to make a projectile that shoots do i go vector3 or cframe since they both move User#22788 5 — 5y
0
@Halmuni, I would use CFrame because of the LookAt Property, that means I could make it face the target and it can also move. Vector3 will not produce the same effect since it might clip over a part and adjust it's position. Formidable_Beast 197 — 5y
0
terrible quality on this answer (no offense) DeceptiveCaster 3761 — 5y
0
its not only the position and the orientation u know User#23365 30 — 5y
Log in to vote
2
Answered by 5 years ago
Edited 5 years ago

A Vector3 is the representation of a single 3D vector, composed by 3 coordinates (X, Y and Z); a CFrame is composed by 3 orthonormal (perpendicular and unit vectors) Vector3 for orientation (rightVector, upVector and lookVector) and 1 Vector3 for position.

0
Hi congrats for posting your first answer on scriptinghelpers :D Amiaa16 3227 — 5y
1
Hello! Thank you!! :) Indecyzo 31 — 5y
Log in to vote
-1
Answered by 5 years ago

When using Vector3 It is much more basic, and You can't teleport players around the map with Vector3. And with Vector3 you can't make parts "NoClip" through other parts.

With CFrame you can: Teleport Players, Make parts "NoClip" through things (Keep in mind Vector3, and CFrame can't be used in GUI'S), CFrame is more "Advanced", lastly keep in mind when Adding a "CFrame value" to another "CFrame Value", you use " * ", but when Adding a "Vector3 Value" times another "Vector3 Value" you use " + ".

0
??????????????????? User#23365 30 — 5y