You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
Model:Pivot, but to rotate model, i want model to rotate
What is the issue? Include screenshots / videos if possible!
01:19:25.924 Workspace.Open_window.Script:6: invalid argument #1 to ‘new’ (Vector3 expected, got number) - Server - Script:6
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried a lot.
--prox.Triggered:Connect(function(playerWhoTriggered)
local centre = Window:GetBoundingBox()
local pos = centre.Position
local targetCframe = CFrame.new(pos)*CFrame.Angles(0,math.rad(15), 0)
Window:PivotTo(targetCframe)
This should work, the RotateWindow function will allow you to change the angle too if you want to later on:
local WindowCFrame = Window:GetPivot()
local function RotateWindow(angle)
Window:PivotTo(WindowCFrame * CFrame.fromOrientation(0, 0, math.rad(angle)))
end
RotateWindow(45)