model = script.Parent model.PrimaryPart = script.Parent.RotationPart model:SetPrimaryPartCFrame(CFrame.new(script.Parent.PrimaryPart.Orientation + Vector3.new(0,0,1)))
I am trying to rotate a model but when I run this script the model teliports to a certain spot, the orientation property changes rotation so I don't understand why its moving position instead.
You are adding a Vector3 and Orientation together to change the position. You are not doing anything to the Rotation of the model at all.
You use CFrame.Angles
to change the rotation. This also takes in radians so we use math.rad to convert.
local model = script.Parent --You can manually do this in the properties window too model.PrimaryPart = model.RotationPart --This will rotate the part 45 degrees on the y-axis local newRot = CFrame.Angles(0, math.rad(45), 0) model:SetPrimaryPartCFrame(model.PrimaryPart.CFrame * newRot)
edit: fixed function error