What does the * sign do in CFrame?

As the tile say, what does the * sign do in CFrame.I heard some people said that it is similar to CFrame:ToWorldSpace() , is that true? because first of all, i didn’t use ToWorldSpace a lot because the * sign can be used to offset the part perfectly and the definition of worldspace definitely change what i really think about CFrame.

ToWorldSpace and * the exact same

a * b will create a cframe thats offset “b” relative to “a”

Firstly it will apply b’s position relative to the rotation of a, then it will add b’s rotation onto a’s rotation after moving

Oh so That could be a replacement for ToObjectSpace too?

Yes, to object space is just

a:Inverse() * c

This can be derived by saying:

If a * b == some world position c

Then what value b, when multiplied by a, will get c?

This is simple algebra with a twist, you solve for b

The “inverse” of a cframe is similar to division in a way, so multiply both sides by a:Inverse()

a:Inverse() * a * b = a:Inverse() * c
The as cancel out

b = a:Inverse() * c

So that way you can get the offset between two world positions

The order of cframe multiplication also matters a lot, a * b is not the same as b * a

1 Like

You help me again, papabread thanks a lot

1 Like