How do I directly set a part's orientation with ":ToPivot" as a opposed to offsetting?

This may be a simple question but no matter where I check I can’t find the answer. I’m trying to directly set a part’s (primary part) orientation using ToPivot, but because it uses the CFrame value, I can’t find a way to has it’s orientation equal the value I want.
For example:

npcCharacter:PivotTo(npcCharacter.PrimaryPart.CFrame * CFrame.Angles(math.rad(0), math.rad(270), math.rad(0)))

I can’t use this because it offsets the rotation by 270 rather than directly setting it to 270. Does anyone know what else I can do?

You can do:

CFrame.Angles(something) + position

To set the rotation. Also be aware there is CFrame.fromOrientation which is different than angles not relevant now but will be if you have a rotation in the Z axis as well.

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