I’m trying to make an animated tween for my friend but it seems to teleport instead of tween.
I am tweening it this way so I can use :Stop() at a certain time.
--{1, 0},{0.075, 0}
--//Variables
local player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local bar = script.Parent
local center = script.Parent.Parent.Center
--//Tweening
local ts = game:GetService("TweenService")
local goal = {}
goal.Position = UDim2.new(1, 0,0.075, 0)
local info = TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
local tween = ts:Create(bar, info, goal)
UIS.InputBegan:Connect(function(input, gameProccessed)
if not gameProccessed then
if input.KeyCode == Enum.KeyCode.E then
bar.Visible = true
--//Tweening
tween:Play()
print("played")
end
end
end)
UIS.InputEnded:Connect(function(output)
if output.KeyCode == Enum.KeyCode.E then
local position = bar.Position
end
end)
Please help