Detect if a view of a player can see the objects in game

I’m trying to make a loader if the view of the player including behind the player can see the objects on a sphere planet for my space game, otherwise if the view of the player can’t see, it will be in saved in replicatedstorage for less performance. How can I detect player view?
(Basically minecraft chunk loading but it’s not chunks but player visibility)

Image to show more context of a “sphere planet”



I’m pretty sure moving large models to and from ReplicatedStorage very fast will cause lag.

What are you experiencing lag with?
There might be some scripts running computationally-heavy code every frame?

Try pinpointing the issue so we can better help resolve it.

Well I’m not actually trying to say I’m experiencing it right now but I know by the time there are more assets or details like trees, plants, or animals, I know for a fact it will lag due to part counts. So I think If you don’t move it fast, it won’t cause lag so that’s why I’m making this post because I think this can fix the lag issue if there is lag.

I’m pretty sure the Roblox engine only renders things that are in-view. You should only resort to these kinds of solutions if you actually experience lag from it.

I still want to go for it and I doubt it only render things that are in view.

This might help:

Keep in mind this gets the parts that are in view. You should have a table of all parts and remove the parts that are visible from it. The parts in this table can be placed in ReplicatedStorage.

Where it gets tricky, is to place the parts back in their original position. I’m not really sure how you could do that.

1 Like