Rotating player to part orientation

I tried this but it sadly doesn’t work

plr.Character:PivotTo(plr.Character.HumanoidRootPart.Position, script.Parent.Parent.Parent.Folder.PositionPart.Orientation)

Also I got this error
1

Thanks for helping

You need to pass a CFrame (aka CoordinateFrame) to the method PivotTo. I’m not sure if this will be the orientation you’re looking for, but you won’t get an error message if you run a line like this:

plr.Character:PivotTo(CFrame.new(plr.Character.HumanoidRootPart.Position) * script.Parent.Parent.Parent.Folder.PositionPart.CFrame.Rotation)
1 Like

Still the same error: “Unable to cast Vector3 to CoordinateFrame”

Oops. My bad. I thought it said PositionPart.CFrame.Rotation not PositionPart.Orientation. I’ll update my first reply.
The Orientation property is a Vector3, but the Rotation property (of a CFrame) is a CFrame. CFrame * Vector3 is a Vector3, but CFrame * CFrame is a CFrame.

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