# Why multiply CFrame.Angles and not add to CFrame?

I am currently experimenting with welds and weld constraints and trying to add CFrame.Angles with a CFrame and get the following error message:

`workspace.Model.Tween.CFrame = workspace.Model.Tween.CFrame + CFrame.Angles(0, math.rad(90), 0):1: invalid argument #2 (Vector3 expected, got CFrame)`

I have found that multiplication has exactly the effect I want, but have no idea why this works! Can someone give me a simple explanation?

Fixed code:

``````workspace.Model.Tween.CFrame = workspace.Model.Tween.CFrame * CFrame.Angles(0, math.rad(90), 0)
``````

Itâ€™s because theyâ€™re matrices

Read this if youâ€™re smart enough:

When youâ€™re multiplying CFrame with `CFrame.Angles`, it means youâ€™re changing the partâ€™s rotation.
Remember, CFrame is useful for both rotation and position.

And yes, as @Prototrode said that nicer, they are matrices.

Remember that `CFrame` also represents position. So it looks like youâ€™re trying to add an angle to a position.[Vector3]

``````CFrame.new(0,0,0) + CFrame.new(0,5,0) -- error
``````
``````CFrame.new(0,0,0) + Vector3.new(0,5,0) -- 0, 5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1
``````

CFrames are â€śtransformation matricesâ€ť, which is a term that comes from linear algebra.

So CFrame.new, CFrame.Angles, etc. all give you a new matrix.

Whoever invented matrices two hundred years ago decided that applying one transformation matrix to another was gonna be called â€śmultiplication,â€ť even though itâ€™s not really like multiplying numbers.

Edit: If thereâ€™s one thing I recommend learning for game dev, itâ€™s the basics of linear algebra. This whole series is fantastic: https://youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab

If you only have time to watch one video, chapter 3 is the most important IMO. Go in knowing that CFrames are transformation matrices. The video explains what a transformation matrix is

1 Like