I've been trying to rotate a player's torso. I've tried Torso and HumanoidRootPart. When I use CFrame it says Vector3 expected but when I use Vector3 it either glitches or kills the player.
You can use CFrame.fromAxisAngle
in order to create a rotation which can be combined with the current CFrame
of the Torso.
1 | local rotation = CFrame.fromAxisAngle(Vector 3. new( 0 , 1 , 0 ), math.rad( 45 )) |
2 | Torso.CFrame = Torso.CFrame * rotation |
The same can be done with HumanoidRootPart if you are dealing with R15 compatibility.
Just use Orientation
.
1 | Torso.Orientation = Vector 3. New(x, y , z) |