But this rotates the model by 90 every time. I want to fix the orientation of the model to 90 so that the model stays at 90 degrees until I change the math.rad(value) to something else.
That’s because you are using GetPivot() which is getting the updated Pivot every time. Instead, you would need to get it’s position only, excluding any rotation values.
You can do this like so:
local getPivot = model:GetPivot()
model:PivotTo(CFrame.new(getPivot.X, getPivot.Y, getPivot.Z) * CFrame.Angles(0,math.rad(90),0))
Since model:GetPivot() returns a new value every time you call it, I suggest doing something like this instead.
local originalPivot = model:GetPivot()
-- Every time you want to update the pivot you call this
model:PivotTo(originalPivot * CFrame.Angles(0, math.rad(90), 0))
That wouldn’t change the new location though in case they are moving the model around. Which is why the method I posted above would work better for both cases.
That should have worked. CFrame.new() has no rotation set. Which means you are setting it to be 90 every time. Not an additional 90, just simply always at 90.