Npc rotation rotation in a strange way

Hello, I’m trying to rotate the npc in the same rotation as the part it is pathfinding to. I have no idea why it is not rotating as it should. I use it all the time, just on the npc’s it’s not doing it correct

Output of the rotation it should take: Asher: 0 -90 0
Output of the rotation it has after setting the rotation: 0 -37.549999237061 0

print(script.Parent.Name ..": " ..TargetPart.Rotation.X .."-" ..TargetPart.Rotation.Y .."-" ..TargetPart.Rotation.Z)
script.Parent:SetPrimaryPartCFrame(HumanoidRootPart.CFrame *CFrame.Angles(0, math.rad(TargetPart.Rotation.Y), 0))
print(HumanoidRootPart.Rotation.X .."-" ..HumanoidRootPart.Rotation.Y .."-" ..HumanoidRootPart.Rotation.Z)

It is rotating as it should. You’re adding rotation onto an already existing rotation in your code, and so is the result.

1 Like

Are there any errors, i there are. Could you show me them?

Thanks a lot, sometimes the easy things just don’t come to mind haha

1 Like