Pivot changes and messes with rotation

When I try to rotate the ladder on the Y axis, then the x axis, the roataion is messed up and causes it to go to the side messed up. How would I do this while keeping the pivot of the model locked? I tried using a different part for the pivot bases that does not rotate but it does rotate at all like it does with the model.


local rotation =  CFrame.Angles(0, math.rad(0), .01) 
local modelCFrame = Model:GetPivot()
   	Model:PivotTo(modelCFrame * rotation)
   	CurrentRotateValueUpDown = CurrentRotateValueUpDown - 1

I fixed it, what I ended up doing was getting another part outside of the model and changed the Ladders pivot each time the rotate function was called using

Model.WorldPivot =  workspace.Part2Pivot.WorldPivot

Then applied thatt here

		local modelCFrame = Model:GetPivot()
		Model:PivotTo(modelCFrame * rotation)
		CurrentRotateValueRightLeft = CurrentRotateValueRightLeft + 1
		local modelCFrame2 =  workspace.Part2Pivot:GetPivot()
		workspace.Part2Pivot:PivotTo(modelCFrame2 * rotation)

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