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

How can I rotate or move a player's character using :SetPrimaryPartCFrame?

Asked by
MiguRB 60
4 years ago

So I want to make a script that does the following:

Creates a Part in front of a player, Sets the player's character's PrimaryPartCFrame to the just created Part, Rotates the Part so that the player's character would rotate too.

Here's a link to an image of what I'm thinking of:

https://pasteboard.co/JieotgU.png

And here's my current code:

Char:SetPrimaryPartCFrame(part.CFrame)

part.CFrame = part.CFrame * CFrame.Angles(math.rad(45),0,0)

Any help would be appreciated!

1 answer

Log in to vote
0
Answered by 4 years ago

To Change the Position, use Character:SetPrimaryPartCFrame To Change the Orientation/Rotation, use Character.HumanoidRootPart.Orientation.

Ad

Answer this question