Loading in parts when they can be seen

Ok so I want to make a script for my game that makes it so that the game only loads bits that are in view of the player. The game is super laggy right now because It loads everything at the same time and even though you are on one side of the map, the other side is still loaded.

How can I do this? I was thinking I could use raycasting and then disable something if I can’t see it.

5 Likes

you could try using Content provider to preload the assets for better game performance

also go into Workspace and find Streaming Content or so and you can try making it disabled or lower the numbers.

2 Likes

I mean that could work but This is after I have done that so I want to use a script to do it because It is easier

1 Like

You can use StreamingEnabled.

1 Like

I did this for my new obby game. One of the stages only show the kill obstacle when the player is close. I put a custom proximityprompt inside the kill part. I put a script in the prompt and set the script to client. The script tells when its transparency should be 0 or 1 with prompthidden and promptshown.

Edit: I reread your post. I think streamingenabled would work if you can group things together to load by chunks that doesn’t have to rely on what’s on the other side of the map or it might break.

1 Like