Cframe – roblox wiki

But wait! CFrames are not just useful for moving bricks around. Msci world sri When you change the CFrame property directly with a command, you can place bricks inside of other bricks. Msci world etf This is something that the Position property cannot do. Msci world healthcare index You can also rotate bricks, but this is a little more complex.

What this does is take the object you want to rotate; creates a CFrame from it’s current location; and uses the * operator to compose the rotation CFrame, which you created with CFrame.Angles

The CFrame.Angles constructor creates a CFrame that is just rotations. Msci stock quote In the Moving Bricks part we created one that was just a position. Msci world index history Bricks use the CFrame for both rotation and position, which is what you create when you use the * operator. Msci definition It takes the position CFrame and the Rotation CFrame, and combines them.

Another useful thing is making one brick point at another one. Msci world sector weights You can construct a CFrame that has a Vector3 base, pointed at another position in the world.


Msci index china This can lead to some arbitrary rotations (in fact, there are an infinite combination of them), but oftentimes this does not matter, as the rotation on two of three Axis Angles are correct.

The following code demonstrates rotating a part so that its position stays the same, but the lookVector (defined as the vector coming out of the front face, or Vector3.new(0, 0, -1) transformed to the parts rotation matrix), is now pointed at 0, 75, 75.

To CFrame more than one object we use the Get Method to create a table of all selected objects, then we use a for loop to CFrame all of the selected objects.

The three rotation vectors (X,Y,Z) are all supposed to be at a right angle from each other, arranged in what is known as the left hand rule. Msci wiki To get an idea of left hand rule, arrange the fingers in your left hand to form the following: your thumb is pointing straight at you, your index finger is pointing straight up, and your middle finger pointing to the right. Msci world index chart The middle finger is indicative of the X vector, the index finger is indicative of the Y vector, and the thumb is indicative to the Z vector. Msci world nr In ROBLOX, the right face matches the X vector, the top face matches the Y vector, and the back face matches the Z vector.

If you attempt to arrange the three rotation vectors in a way that doesn’t conform to the left hand rule, the CFrame will ignore the improper components by comparing the first vector to the second vector then throwing out the components of the second vector that lie on the first vector, then it will repeat the same with the third vector.