What is CFrame?
CFrame is a hidden property that uses only Position, and Orientation (aka Rotation) which is probably why it's hidden.
How do I use it?
Lets start with changing position with CFrame. It's just like how you would with the position property, but instead of Vector3.new() it's CFrame.new()
game.Workspace.Part.CFrame = CFrame.new(0,5,0)
Moving on, we have orientation. This is how you change orientation with CFrame.
game.Workspace.Part.CFrame = CFrame.Angles(0,math.rad(45),0)
The reason we use math.rad() is because you have to change the rotation in Radians, not Degrees. math.rad() takes a degree value, and returns the radian conversion of it. There's a way you can change Position, and Orientation with CFrame at the same time! here's how you do it.
CFrame.new() has a bunch of different arguments: CFrame.new(x,y,z,r00,r01,r02) there are other ones, but these are the ones we need to know.
game.Workspace.Part.CFrame = CFrame.new(Vector3.new(0,5,0),Vector3.new(0,math.rad(45),0)
And there you have it. The CFrame Basics. I will be make a part 2 to show some other stuff about CFrame.
Easy Written By marioman1932
See marioman1932's profile on Roblox