So I'm tweening GUIs I have no problem whatsoever but whenever I play the tween repeatedly the tween stops for a little bit then continues on. I don't know why this is happening but it has to do with multiple tweens happening at once.
I am only tweening for a tool when it's equipped and dequipped, I want to know if the tween can be directly interuptted.
Here's a video on youtube to see what I'm talking about:
https://youtu.be/i24V9YSj7j8
Here is the code for tweening those two guis in the video:
The code for all the tweening goals and TweenInfo:
local ScopedInCameraGoal = { FieldOfView = 45 } local ScopedOutCameraGoal = { FieldOfView = 70 } local InScopedImageGoal = { ImageTransparency = 0 } local OutScopedImageGoal = { ImageTransparency = 1 } local AmmoWithdrawalGoal = { Position = UDim2.new(0.838, 0, 0.894, 0) } local AmmoDepositGoal = { Position = UDim2.new(0.844, 0, 1, 0) } local TweeningInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0) -- tweening time is 0.5
Tweening up and down the position of the ammo GUI:
-- when the tween is finished disable the ammo GUI local function WithdrawlAmmoGUI() AmmoGUI.Enabled = false end -- equipping the tool local function EquipTool() local Tween = TweenService:Create(Frame, TweeningInfo, AmmoWithdrawalGoal) Tween:Play() end -- unequipping the tool local function UnequipTool() local Tween = TweenService:Create(Frame, TweeningInfo, AmmoDepositGoal) Tween:Play() Tween.Completed:Connect(WithdrawlAmmoGUI) end
Aiming in third person and tweening the Camera's FOV and a black screen effect:
local function AimTool() local Tween = TweenService:Create(Camera, TweeningInfo, ScopedInCameraGoal) Tween:Play() OutScopeImage.Visible = true -- making the black screen visual visible local ImageTween = TweenService:Create(OutScopeImage, TweeningInfo, InScopedImageGoal) ImageTween:Play() end function UnAimTool() local Tween = TweenService:Create(Camera, TweeningInfo, ScopedOutCameraGoal) Tween:Play() local ImageTween = TweenService:Create(OutScopeImage, TweeningInfo, OutScopedImageGoal) ImageTween:Play() ImageTween.Completed:Connect(DisableScope) -- DisableScope() is just a function that makes the image not visible. end
All tweens that are tweening a GUI that is "making it disappear" will have a function in the .Connected event to fire after the tween is done to make the image that is tweened away not visible.
All tweens also use the tweeninfo, that's why I stated it as a variable so each tween can globally access it at the same time.
It's hard to explain this through just this but there is a video on youtube provided in case you missed it. I've tried to fiddle with the time it takes for the tweens to complete but that gives an uncomfortable feeling and still causes the problem
I'm not sure why this is happening and sorry if this post is a bit too long since I can't wrap my head around all of the tweening stuff. I think it has to do something with the TweenInfo and it's time parameter.
i saw no issue in video