Simply change the orientation of the BasePart to rotate it, its one of its properties
So by doing BasePart.Orientation you get the current orientation, then you can simply do BasePart.Orientation = BasePart.Orientation + 40 to rotate it by 40 degrees.
Ah, right. This is my field of ‘expertise’ right here.
I would definitely go for, and use the method CFrame.fromOrientation(rX, rY, rZ) to apply orientation to a BasePart.
Where rX is up/down, rY is left/right and rZ is tilt left/right. Oh, and remember, these rotations are in radians. To convert degrees to radians, simply use math.rad(deg) or math.deg(rad) for radians to degrees. Also, remember that the symbol * is basically the same as addition +, just for CFrames.
Well, I’m slightly confused then because from the example you provided of what you want :ToWorldSpace(), which is how you rotate something relative to its current orientation a specified amount, whereas running multiplication as you normally would is relative to the world itself?
Seeming as we use x y z, by changing the x y z values you’d be rotating around the specified axis. And so if you only want to rotate around a singular axis you’d do Cframe.Angles(0,0,math.rad(7)) for the z component only.
Haha, I used to bring a lot the function fromOrientation() to solve my problems, but in that case it would in no way fix the problem. I given a method that rotates FROM a directional vector, a total different case.
Which concerns your answer format, I really like it and it’s very intuitive ! Keep it up.
I’m not particularly sure how you can rotate a part 40 degrees in the “RightVector” as you showed because thats not how angles work.
What I have been trying to say is that by doing :ToWorldSpace() with an angle in the brackets you rotate it relative to the parts current orientation, with the rX, rY and rZ being the different ways you can orientate a part…
By looking at your video, if you want to do it relative to the world space then it would simply be:
Part.CFrame = Part.CFrame * CFrame.Angles(math.rad(40), 0, 0) -- this would be 40 degrees in the x axis relative to the world.
With the parameters being:
CFrame.Angles(rX, rY, rZ) where: