Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I rotate a player's torso?

Asked by 5 years ago

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.

2 answers

Log in to vote
2
Answered by
amanda 1059 Moderation Voter
5 years ago

You can use CFrame.fromAxisAngle in order to create a rotation which can be combined with the current CFrame of the Torso.

local rotation = CFrame.fromAxisAngle(Vector3.new(0, 1, 0), math.rad(45))
Torso.CFrame = Torso.CFrame * rotation

The same can be done with HumanoidRootPart if you are dealing with R15 compatibility.

0
How do I make a player face the same direction as a part with that method? AvionicScript 65 — 5y
0
If you are trying to make the character face a part, you should instead use CFrame.new(pos, lookAt) amanda 1059 — 5y
0
Torso.CFrame = CFrame.new(Torso.Position, Part.Position) amanda 1059 — 5y
0
Thank you AvionicScript 65 — 5y
Ad
Log in to vote
0
Answered by
valchip 789 Moderation Voter
5 years ago

Just use Orientation.

Torso.Orientation = Vector3.New(x, y , z)
0
.new() not .New() EpicMetatableMoment 1444 — 5y
0
^^^ valchip 789 — 5y
0
That way it kills the player.. AvionicScript 65 — 5y

Answer this question