I was finishing up the teleporting part of my game, and I wanted to make cool little transitions. However, when I implemented them, I noticed some very strange behaviors
- For some reason, when you teleport to a secondary place from the main place, it doesn’t remove the default loading screen and doesn’t transition
- However, when you teleport from a secondary place to the main place, it does remove the loading screen, but lacks a transition
Here’s a demo video (Note: “game” is the main place, and “Oasis” is the secondary place)
https://streamable.com/i3gohc
Here’s the code I use:
local transitions = require(game.ReplicatedStorage:WaitForChild("Modules").Transitions)
local tpService = game:GetService("TeleportService")
local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
tpService.LocalPlayerArrivedFromTeleport:Connect(function(customLoadingScreen, data)
print('incoming '..customLoadingScreen)
customLoadingScreen.Parent = playerGui
game.ReplicatedFirst:RemoveDefaultLoadingScreen()
wait(5)
transitions.Untransition(customLoadingScreen)
end)
--NOTE: I use this code for all the places, including the secondary place
--And also, for some reason it doesn't actually print the customLoadingScreen instance... weird...
Yes, I did do :SetTeleportScreen()
, and I made sure the localscript was in ReplicatedFirst
No clue on why this is happening. Any ideas? Solutions?