PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

RequestStreamAroundAsync

For games where Workspace/StreamingEnabled|StreamingEnabled is set to true, requests that the server stream to the player regions (parts and terrain) around the specified X, Y, Z location in the game world. It is useful if the game knows that the player’s datatype/CFrame will be set to the specified location in the near future. Without providing the location with this call, the player may not have streamed in content for the destination, resulting in a streaming pause or other undesirable behavior.

The effect of this call will be temporary and there are no guarantees of what will be streamed in around the specified location. Client memory limits and network conditions may impact what will be available on the client.

Usage Precaution

Requesting streaming around an area is not a guarantee that the content will be present when the request completes, as streaming is affected by the client’s network bandwidth, memory limitations, and other factors.

For more details, see the articles/content streaming|Game Content Streaming article.

Parameters

Name Type Default Description

World location where streaming is requested

0

Optional timeout for the request

Returns

Return Type Summary

No return


Code Samples


Streaming Requests

If you set the DataType/CFrame of a player to a region which isn’t currently loaded, streaming pause (if enabled) will occur. If you know the player will be moving to a specific area, you can call RequestStreamAroundAsync() to request that the server sends regions around that location to the client.

The following scripts show how to fire a client-to-server articles/Remove Functions and Events|remote event to teleport a player within a place, yielding at the streaming request before moving the character to a new CFrame.