Vector 3 expected got number(Model:Pivot)

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    Model:Pivot, but to rotate model, i want model to rotate
  2. 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
  3. 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)
	Window:PivotTo(CFrame.new(math.rad(Vector3.new(0,15,0))))
end)

Sorry, I just don’t know any better, I just want to rotate it to 0,0,45

You are converting the vector3 into a number with math.rad. Try this instead:

Window:PivotTo(CFrame.new(Vector3.new(0, math.rad(15), 0)))

maybe can you try this?

--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)

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