TweenSize doesn't display the second time

So I’ve recently crashed into a very annoying issue that I am unable to find further information about. So in my game, whenever a round starts, the system will teleport all online players. When a player is teleported I want it to display 2 tweens, one going in and one going out. Problem is that the second tween does not display, though it still outputs and proceeds with the rest of the script.

  1. What do you want to achieve?
    I want to achieve a transition for whenever a player gets teleported.

  2. What is the issue?
    The Tween displays the first time but doesn’t do anything the second time. It gives me an output but nothing changes

  3. What solutions have you tried so far?
    Searching it up on developer.roblox.com but didn’t seem to help

local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

local Image = script.Parent.TransitionCircle
local TransitionBindable = game:GetService("ReplicatedStorage"):WaitForChild("Remotes"):WaitForChild("Transition BindableEvent") 
local MinSize = 0
local MaxSize = 2.5
local TimeVar = 3 -- This variable changes how long it takes for the tween

Image.Size = UDim2.fromScale(0,0)

local function ActivateTransition() 
	TransitionBindable:Fire()
end

local function TweenFunction(Thing, EndSize, Direction, Style, Time)
	Tween = Thing:TweenSize(UDim2.fromScale(EndSize,EndSize), Direction, Style, Time)
	wait(Time)
end

TransitionBindable.Event:Connect(function()
		print("Transition")
		script.Parent.Enabled = true
		Image.Size = UDim2.fromScale(MaxSize,MaxSize)
		TweenFunction(Image, MinSize, Enum.EasingDirection.In, Enum.EasingStyle.Quint, TimeVar)
		print("done with first tween")
		wait(5)
		TweenFunction(Image, MinSize, Enum.EasingDirection.Out, Enum.EasingStyle.Quint, TimeVar)
		print("done with second tween")
	
end)
wait(5)
ActivateTransition()

Basically every time I run it it starts out by showing the first part of the transaction and printing:
done with first tween
then it waits 5 seconds and does not show anything, but prints:
done with second tween
‎
‎

The answer should hopefully be pretty straight forward :’)
Sincerely, Mathe

It looks like the second tween is set to do the exact same thing as the first tween. You don’t see the second tween because the properties of the image are already there.

I tried that, didn’t work :confused:
By the way thank you for mentioning it. It was actually not intended, but it still does not work when I change it to Out (instead of In)
image

The easing direction controls the way the easing style is played (start fast end slow or start slow end fast). Refer to this EasingDirection for better understanding. You’ll need to set a different property (minsize) for the second tween.

THANKN YOU THANK YOU THANK YOU

I realized what I did wrong here, thanks to this. It has been a struggle for quite a while, so I’m very thankful for your help.

To anyone who wants an explanation, what I did wrong was modifying the easingdirection, as this did not change anything but the speed and accelleration of the tween. The reason to why I could not see the second tween was because the image that I was tweening had gone outside of the screen. Basically, all I would have to do to prevent this is changing the tween EndSize, which is previously defined as MinSize. This should therefore be changed to my defined variable called MaxSize.

Solved by @GamesAllRuined

1 Like