Rotate CFrame with CFrame

I want to be able to do this dynamically. So rotate whatever by whatever.

Okay well that transformation is described by something like: CFrame.Angles(0,0,math.pi/2)

Well, multiplying won’t get you anywhere, but I think that you need to be doing this in ObjectSpace. If that didn’t help, I cannot solve this.

This still leaves the whole torso situation a bit in the dark though I’m afraid. Not sure where the “dynamic” part comes in.

By dynamic, I mean a way to choose what to rotate by what like if a function existed for that the argument would not be fix. And the way to solve the torso is by rotate the gyroscope CFrame by the torso CFrame which is what we are here for.

It is the same thing as rotating a vector but with orientation.

AngleCFrame * PositionCFrame rotates around the global origin. For example:

CFrame.Angles(0, math.pi/2, 0) * CFrame.new(10, 0, 0) 

This code would rotate the positional CFrame around the global origin 90 degrees on the Y axis (not sure if clockwise or counter-clockwise)

1 Like