# Why does the order of multiplication matter here? [ Transform.basis * Vector3 ]

Attention Topic was automatically imported from the old Question2Answer platform.
``````Translate(targetVelocity * PlayerBody.GlobalTransform.basis); //BAD
``````

has different results than

``````Translate(PlayerBody.Transform.basis * targetVelocity); //GOOD
``````

Why is this?

I thought order didn’t matter with multiplication (ex. 4x3 == 3x4)
Is it something to do with the fact its a matrix?

Enlighten me.

Yes it does matter because it is a matrix. To transform a vector by a matapplrix the matrix has to come first when you do the multiplication. Otherwise it does not make much sense. If you tried to do matrix transformation by hand you would see that.

Also multiplying two or more basis together follows this same rule, the leftmost basis is the last transformation to be applied.

Thank you. My math skills are lacking so matrices went way over my head. Just needed to confirm that was the reason.

dezboyle | 2022-12-17 19:22

The documentation has a good intro to all these matrices and vectors that could help you get started.

magicalogic | 2022-12-17 21:15