I’m trying to make a helmet protraction and retraction script that allows the helmet to tween over the player’s head and back, but it keeps acting weirdly as seen in the video.
This is the script so far:
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.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 = Helmet.CFrame * CFrame.new(0,0,-2)
local Tween = TweenService:Create(Weld,Info,OpenGoal)
Tween:Play()
end
while true do
CloseHelmet()
wait(2)
OpenHelmet()
wait(2)
end
How do I make it so that the helmet slides back as intended? And why is it zooming from the baseplate to the head and back?