Cant tween gui?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want to use tween on teleport gui

  2. **What is the issue?**It’s say exception while signaling Unable to cast to dictionary

local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local tinfo = TweenInfo.new(4,Enum.EasingStyle.Linear)
local goals = {}
goals["Transparency"] = 1
local customLoadingScreen = TeleportService:GetArrivingTeleportGui()
if customLoadingScreen then
	local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
	ReplicatedFirst:RemoveDefaultLoadingScreen()
	customLoadingScreen.Parent = playerGui
	task.wait(5)
	game.TweenService:Create(customLoadingScreen.Frame,tinfo,goals)
end

Disable this script and load the game. Does it still come up with the error? If yes, I believe this to be a part of this?

Hmm yes it seems to, but also, The tween seem abrupt, I set the time to 4 so Idk why it suddenly dissapeared

local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local tinfo = TweenInfo.new(4,Enum.EasingStyle.Linear)
local goals = {}
goals["Transparency"] = 1
local customLoadingScreen = TeleportService:GetArrivingTeleportGui()
if customLoadingScreen then
	local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
	ReplicatedFirst:RemoveDefaultLoadingScreen()
	customLoadingScreen.Parent = playerGui
	task.wait(5)
	--for count = 1,100 do
		--customLoadingScreen.Frame.Transparency = (count/100)
		--game["Run Service"].RenderStepped:Wait()
		
	--end
	print("Tweening")
	game.TweenService:Create(customLoadingScreen.Frame,tinfo,goals)
	print(TweenInfo)
	task.wait(4)
	print("DESTROYING")
	customLoadingScreen:Destroy()
end

Rather than using task.wait, you can check if the tween has been completed by using:

tween.Completed:Connect(function()

Also how come you aren’t using tween:Play() after creating the tween?

1 Like

You forgot to play the tween at line 13, Do

game.TweenService:Create(customLoadingScreen.Frame,tinfo,goals):Play()

In a synchronous function it’s much better to use tween.Completed:Wait() instead of connecting it to a function

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.