Disable entity when camera can't see it

How would I do this? I want to do this idea so that the player has a smoother experince, instead of the whole map taking up space constantly. Another way is possibly view distance? Maybe someone could tell me how to make it so entitys at a certain range disable, then reenable when they get closer? I need help.

Hey, this thread may help resolve your issue

3 Likes

Thank you! I am lucky that playcanvas has such a kind and responsive community.

If camera does not see an entity with the mesh as an example, the mesh is not rendered automatically - so this you don’t need to do.
Are you trying to disable updates of the script on the entity? Or what is it specifically you’re trying to disable.

Usually things like this are done using some grid system. You test individual cells for visibility, and load / enable their content when nearby / visible or similar. This is a typical level streaming system. Is this what you are after?

4 Likes

I want to disable the complete entity, such as built-in models like box, cylinder, and sphere. I use these to make my own models in playcanvas. I want to do so to save space and I need the game to load faster and I want the players to have a smooth experience.

Yes, yes it is. How would I do so? And if not too complex can you do it for me/show me a project where this is done?

Hi @Imarri

Playcanvas doesn’t provide that out of the box and I don’t remember any public project having that system, you would have to develop that system.

2 Likes

Okay, thanks for your helpful feedback on this topic.