Rotate a CFrame orientation like a vector

you could try

CFrane1:ToWorldSpace(CFrame.Angles(X, Y, Z))

The piece of code you gave me didn’t fix the issue as there is nothing to realign the axises neither did it works ( tough it was funny see the head fly away ).

About the way to fix the axises, the x, y, z component are the rotation of the torso and multiplying the two doesn’t work. As I stated before, to realign the axises we need to “rotate”/swap but in a way which follows the torso rotation so just swapping one axis for another will not always work.

Thanks anyways, and if you have something else in mind, feel free to tell me.

Surprisingly, this doesn’t work. Tough, if you look at the code, I’m using this function to apply an offset to the rotation for the camera ( cameras have a -90 degrees offset ) and, make the axises align after I did to prevent the same issue from happening.

if you wanted to use degrees you would have to use math.rad() because this constructer takes in radians

I do use math.rad else it just breaks as it try to interpret degrees as radians.

so if you use math.rad it breaks?

No, if I don’t use it, it breaks.

I guess you didn’t try and tweak it then or try this:

I did try it multiple times but it only piles them on top of one another ( add ).
This is the pile up behaviour I’m talking about.

[ 1, 0, 0 ] +
[0, 1, 0 ] =
[ 1, 1, 0 ]

What I’m trying to do is rotate the “axises” themself as if they were directions vectors ( UpVec, RightVec … ) on a part which gets rotated so maybe the up vector will become ( 1, 0, 0 ) and so on. You can see the behaviour I want if you do :
CFrame.Angles(math.rad(45), 0, 0):VectorToWorldSpace(Vector3.new(0, 90, 0))

It is close to what I need but it returns weird values as in this case ( 0, 63, 63 ) instead of ( 0, 45, 45 ).

CFrame.Angles(math.rad(45), 0, 0):VectorToWorldSpace(Vector3.new(0, 90, 0)) is the same as CFrame.Angles(math.rad45), 0, 0) * Vector3.new(0,90,0).

Your explanation in terms of adding vectors makes no sense to me as that is not how rotations with cframes work.

To clarify further if you want to rotate between axis you can multiply by CFrame.fromAxisAngle( Vector3.new(1,1,1).Unit, math.rad(120) ) and that should send x → y, y → z z → x (or the other way round).

This is maybe what I need. Though if it is, It will still need a bit of modifications.

When you say multiply, what are you saying to multiply?

Some other CFrame. Like the head CFrame or device CFrame.

I tried it but I doesn’t really works. I’m going to try explaining what I’m trying to do with images. Hopefully, it should be clearer and you would be able to help me.

My goal is to rotate a CFrame rotation using another CFrame rotation.
In this example, I’m going to be rotating ( 90, 0, 0 ) by ( 0, 90, 0 ). In the images, the rotation being rotated ( first one ) will be represented as the red line ( the part.CFrame RightVector ).

We start with the red line pointing toward the part RightVector ( 1, 0, 0 ) which is the equivalent to 90 degrees on the X axis for us.

If we now turn the part by 90 on the Y axis, the red line will still be pointing toward the part RightVector but it will now be equal to ( 0, 1, 0 ) which in our case means 90 degrees on the Y axis.

This is how I’m trying to make the rotation work. In the previous examples, I tried explaining it as CFrames vector as it is the easiest way to visualize what is happening.

I hope this helps.

What does this mean though? 90 degrees from the axis? 90 around the x axis?

This is just a discussion about the terminology of rotations though at this point.

On it, Imagine the RightVector as a rotation which in our case is ( 90, 0, 0 ).

Yeah my point is that what you’re saying doesn’t make sense and you just repeated the statement. I think you would receive more help if you used more standard language when referring to the rotations.

Yeah but if I use standard language, you tell me the wrong thing over and over.

You have to use ToWorldSpace Function, and use CFrame.Angles