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

What's the difference between CFrame and Vector3?

Asked by 9 years ago

I'd like to know this. Does it have anything to do with the way the part is positioned or moved?

Help is appreciated.

1 answer

Log in to vote
3
Answered by 9 years ago

CFrame and Vector3 are two different types of data. CFrame has a rotation matrix which allows it to store rotational values for objects. Vector3 is just a point in 3D space.

Values like position use Vector3. Parts do have a CFrame property as well. Which can be accessed by using:

part.CFrame

As I said before. CFrame allows you to set rotation as well as position. To do so you can use:

part.CFrame = CFrame.new(x,y,z) * CFrame.fromEulerAnglesXYZ(math.rad(x),math.rad(y),math.rad(Z))

I would be happy to help you with futher help if required. However, I would suggest reading the wiki articles on CFrame and Vector3

Ad

Answer this question