I’m trying to make a little “procedural cutscene” where the camera rises up to look down at the player when they die. Although I’m using a custom camera script, it gets disabled when the player dies so it doesn’t conflict with the animations. This line of code is supposed to make the camera rise up into the air:
I dont believe there is a difference to which operands go where when you multiply CFrames. The camera moving up on local position is the problem. I’m trying to make it go upwards regardless of what orientation the camera is.
Suppose you have a Part that is rotate in some arbitrary way in world space, so that it’s CFrame is already not an identity. In other words, the Part’s Up, Right and LookVectors are not just the world up, right and look directions.
Now, make a CFrame like so:
local rotCF = CFrame.fromOrientation( 0, 0.5 * math.pi, 0)
This is a 90-degree Y-axis rotation. But consider these two expressions:
A) part.CFrame = part.CFrame * rotCF
B) part.CFrame = rotCF * part.CFrame
Option A will rotate the Part around its own UpVector, not around the world Y axis. Furthermore, because rotCF is a pure rotation, the Part.Position will not change.
Option B will rotate the Part around the world Y-axis 90-degrees. And if the part is not at the world origin, its position will also change! If the part is at 100,2,0, a 90-deg world Y-axis rotation will move it to 0,2,-100.
So yeah, very different outcomes. They are only the same if the Part is already at the world origin with identity orientation (all part axes already the same as world axes).