What does Player:RequestStreamAroundAsync() do?

Hello!

The other day, I was reading some old Roblox scripts from a template and I came across this line:

Player:RequestStreamAroundAsync(FocalPoint)

What exactly does this function do? The documentation didn’t exactly make a whole lot of sense to me, and I couldn’t find any topics further explaining this.

If you can clarify what this does, please let me know! Thank you and have a wonderful day! :slight_smile:

3 Likes

In-experience instance streaming allows the Roblox engine to dynamically load and unload 3D content and related instances in regions of the world.

Instance streaming (or streaming enabled) is basically loading to the client only the areas in a certain radius from the player (based on your streaming settings) with regards to the device’s available memory. (If your streaming type is set to LowMemory)

What Player:RequestStreamAroundAsync(FocalPoint) does is that it requests to stream (load) the areas around FocalPoint (which is a position in the world) to the player.

2 Likes

This makes sense! Thank you so much!

One thing, though: what’s the point of Instance Streaming? Is it like loading specific instances and areas onto the client to avoid overwhelming the server on low-end devices?

There are a few reasons to use streaming, it allows you to create big worlds and not have the whole world load at once for the player, reducing join times and out-of-memory crashes.

1 Like

So should I be using this in my game or only when I am making a very big, very detailed map?

That is a good question. You can play around with the streaming settings (properties of Workspace) to see if streaming is right for your game.

In general, I would say streaming isn’t always necessary if your game has few assets to load.

Streaming is now enabled by default when you create a new experience so there’s a good chance you have had it enabled and didn’t even notice.

1 Like

That makes sense! Thank you so much for explaining!

If I do have streaming enabled, would I notice a difference or would it only be the players who do?

You would most likely notice a difference with assets far away from you in the workspace. They might exist on the server and not on the client. That is because they were streamed out, which is normal.

Make sure you follow the best practices if you do decide to have it on:

You can see in the image above for example, that when you move a player’s character by setting it’s CFrame, you should do so from a server script, and use Player:RequestStreamAroundAsync to load the area around them.

1 Like

Thank you so much for this! I will have to read more about instance streaming! Have a great day! :slight_smile:

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