Here I have a script that’s supposed to tween the helmet into an opened and closed position, but it’s not moving.
local TweenService = game:GetService("TweenService")
local Head = script.Parent
local Helmet = Head.Helmet
local Info = TweenInfo.new(
1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.InOut,
0,
false,
0
)
local Weld = Instance.new("Weld")
Weld.Part0 = Head
Weld.Part1 = Helmet
Weld.Parent = Head
local function CloseHelmet()
local CloseGoal = {}
CloseGoal.C1 = CFrame.new(0,0,0)
local Tween = TweenService:Create(Weld,Info,CloseGoal)
Tween:Play()
end
local function OpenHelmet()
local OpenGoal = {}
OpenGoal.C1 = Helmet.CFrame * CFrame.new(0,0,-2)
local Tween = TweenService:Create(Weld,Info,OpenGoal)
Tween:Play()
end
while true do
CloseHelmet()
wait(2)
OpenHelmet()
end
Where does my error lie? How do I offset the helmet into an open position from its closed position?