I am making a helmet that retracts and protracts over a player’s head, as you can see in the clip, it’s partially working so far but I want to move the helmet down after it goes backwards, how do I add another cframe direction to do that?
The script so far:
local TweenService = game:GetService("TweenService")
local Head = script.Parent
local Helmet = Head.Helmet
local Info = TweenInfo.new(
0.2,
Enum.EasingStyle.Linear,
Enum.EasingDirection.InOut,
0,
false,
0
)
local Weld = Instance.new("Weld")
Weld.C0 = CFrame.new(0,0,0)
Weld.C1 = CFrame.new(0,0,1)
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 = CFrame.new(0,0,-1)
local Tween = TweenService:Create(Weld,Info,OpenGoal)
Tween:Play()
end
while true do
CloseHelmet()
wait(2)
OpenHelmet()
wait(2)
end
I’ve tried multiplying this line OpenGoal.C1 = CFrame.new(0,0,-1)
by another cframe.new but it causes the helmet to just zoom into space.