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

Multiplying CFrame doesn't really multiply?

If I were to do

workspace.Part.CFrame = workspace.Part.CFrame * CFrame.new(0,0.5,0)

It would cause the brick to raise half a stud. But that does not make sense, because I'm multiplying. What really should happen is the x and z should both move to 0, (since multiplying any number by 0 equals 0). Then, the y should be equal to the original CFrame divided by 2 (since it was multiplied by 0.5)

Therefore it seems to me that * behaves the exact same way as + would. I don't understand this.

1 comment

0

CFrames are matrices; this is matrix multiplication, which is a real math thing, and acts like this (which is not intuitive but is very useful).

1 answer

✓ Accepted answer

When you are "Multiplying" its actually adding

Before I explain: Why Workspace.Parent 0-o I don't think you can get the CFrame of the game -.-

Say you do workspace.Part.CFrame = workspace.Part.CFrame * CFrame.new(0,0,3) that will make the part go back 3 studs depending on what rotation or direction its at but if you do

Workspace.Part.CFrame = Workspace.Part.CFrame + Vector3.new(0,0,3) that will add to the CFrame's position 3 studs in Z axis and not care for the rotation and position its at

Note: If you multiply CFrame then you can out put a Negative in the x or y or z axis for it to go forward instead of backwards.

2 comments

1

This is matrix multiplication. You are not adding; you are multiplying matrices http://en.wikipedia.org/wiki/Matrix_multiplication http://wiki.roblox.com/index.php/Transformation_matrix

0

I meant workspace.Part, sorry. And thanks blue.

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