Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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 comment

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.