So, I’m trying to make a door that slide, but I get an error which is
Unable to cast Vector3 to CoordinateFrame
I have tried many things but still can’t fix it after 1 hour
i just can’t do anything my brain is dying
The code is bellow
any help appreciated
local TweenService = game:GetService("TweenService")
local Model = script.Parent
local Door = script.Parent.Door
local StatusVALUE = Model.Status.Value
local Infos = TweenInfo.new(
2,
Enum.EasingStyle.Quad,
Enum.EasingDirection.Out,
0,
false,
0
)
Model.Button.proxy.Triggered:Connect(function()
if StatusVALUE == false then
local OpenedP = Model.Opened.Position
local DoorOpeningTween = TweenService:Create(Door:PivotTo(OpenedP) ,Infos)
DoorOpeningTween()
StatusVALUE = true
else
local ClosedP = Model.Closed.Position
local DoorClosingTween = TweenService:Create(Door:PivotTo(ClosedP) ,Infos)
DoorClosingTween()
StatusVALUE = false
end
end)
local TweenService = game:GetService("TweenService")
local Model = script.Parent
local Door = script.Parent.Door
local StatusVALUE = Model.Status.Value
local Infos = TweenInfo.new(
2,
Enum.EasingStyle.Quad,
Enum.EasingDirection.Out,
0,
false,
0
)
Model.Button.proxy.Triggered:Connect(function()
if StatusVALUE == false then
local OpenedP = Model.Opened.CFrame
local DoorOpeningTween = TweenService:Create(Door:PivotTo(OpenedP) ,Infos)
DoorOpeningTween()
StatusVALUE = true
else
local ClosedP = Model.Closed.CFrame
local DoorClosingTween = TweenService:Create(Door:PivotTo(ClosedP) ,Infos)
DoorClosingTween()
StatusVALUE = false
end
end)
Vector3 = 3 “digit” combo, i.e. (90, 85, -17); CFrame (CoordinateFrame) is just a CFrame value-
Because PivotTo is a CFrame function, you need to pass a CFrame. (Vector3’s will error.)