How to wait until the terrain around a certain place is >Completely< Loaded

My spawn system works with loading player character and then teleporting it to the nearest place he was when left/died. sometimes it can be far from the original place it spawns. so when it does, the terrain may not be loaded, so it teleports to a place without terrain and everything and falls into the void. i just need to know if theres a bool or anything to wait until to delay my loading screen time and the player teleporting.

1 Like

I think you could request to stream in that area using Player:RequestStreamAroundAsync() on the CFrame of the end location (prior to teleporting the player there) so that it begins to pre-load the region ahead of time.

According to the documentation for Player:RequestStreamAroundAsync(), this applies to both Terrain and Parts.


However, take note that it also clarifies that this won’t guarantee that the area is fully loaded prior to teleporting the player’s Character. If it’s not consistent enough, you could consider adding an additional delay to compensate.


Here’s the example code provided on the first Roblox Creator Hub Documentation site page that I referenced:

-- Example code block from the Roblox Creator Hub's "Instance Streaming" guide
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local teleportEvent = ReplicatedStorage:WaitForChild("TeleportEvent")

local function teleportPlayer(player, teleportTarget)
	-- Request streaming around target location
	player:RequestStreamAroundAsync(teleportTarget)

	-- Teleport character
	local character = player.Character
	if character and character.Parent then
		local currentPivot = character:GetPivot()
		character:PivotTo(currentPivot * CFrame.new(teleportTarget))
	end
end

-- Call teleport function when the client fires the remote event
teleportEvent.OnServerEvent:Connect(teleportPlayer)
1 Like

i already know about that thing, my only problem quoted was the delay between starting and ending RequestStreamingAround because the time it takes to load may float much between players, like on my pc sometimes it takes 40s but on normal roblox it is really faster.

Oh, I didn’t know you had already experimented with that because you didn’t mention what solutions you tried in the original post:


In the past, I haven’t really worked with large-scale maps while StreamingEnabled is turned on, so aside from what I mentioned in my previous post, that’s pretty much the only solution I am aware of at the moment, but I’ll look through the Developer Forum to see if I can find any other recommendations for making that possible with less delay.

However, if the main reason that Player:RequestStreamAroundAsync() is taking such a long time during your playtests is in fact due to varying hardware / network performance of the client, then I am not sure if there would be any other easy-to-implement alternative solutions while still continuing to use StreamingEnabled with Roblox’s built-in Terrain, especially when considering that Player:RequestStreamAroundAsync() was specifically designed for this use case.