How can I rotate player model based on a part orientation?

Hi developers! I’m still trying to solve my problem in about 3 days and still nothing, even if i searched on webs. I’m working on a wall run system and I’ve tried using Player.Character.HumanoidRootPart.Orientation = part.Orientation. Here is the result…

The glitch in this image appear when i run a command in running mode. I will appreciate any help! :grinning:

Well more explanation will be apreciated

is this what you’re trying to do?


if so, thats because you just did playerOrientation = partOrientation and it’ll be

(blue is the player and black is the part)

Exactly this! Do you have any idea? Because when i just write Player.Character.Root.Orientaion = part.Orientation it runs like in the image i posted before, but in another direction. In the image i posted is just an example…

Try using

player.Character:PivotTo(player.Character.RootPart.Position, part.Orientation)

hmmm. It says Unable to cast Vector3 to CoordonateCFrame. Here is how I used it workspace.Zacus57:PivotTo(workspace.Zacus57.HumanoidRootPart.Position, workspace.Part.Orientation)

My bad, do this instead:

workspace.Zacus57:PivotTo(CFrame.new(workspace.Zacus57.HumanoidRootPart.Position, workspace.Part.Orientation))
1 Like

It is good when i use it on a default part. But when i use on wall it goes like this:

Completely Ragdoll The wall Is behind

Is the wall rotated upside down, by any chance? If you just want it based on Y rotation you can do

workspace.Zacus57:PivotTo(CFrame.new(workspace.Zacus57.HumanoidRootPart.Position, Vector3.new(0, workspace.Part.Orientation.Y, 0))


I tried this with wall and a part and the same thing. But what if I stop trying math and just insert an instance part that will be rotated with the wall, and the set player position with the part like this:

local part = Instance.new('Part', model)
part.CanCollide = false
part.Anchored = true
part.Transparency = 1
part.Position = RootPart.Position
part.Orientation = model.Wall.Orientation
RootPart.CFrame = part.CFrame
part:Destroy()

EDIT: The wall wasn’t rotated upside down, only with Y rotation

This is basically the same thing but with extra steps, I don’t see how this would help.

Do you think :PivotTo works in other cases?

1 Like

It should. Can you send a video of what happens when you pivot to the part?

Nevermind…I just found the solution ( part idea ) but i was just trying to do it with CFrames. Thanks very much!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.