- Home /
Deactivate/activate objects depending on player position
I'm creating a big VR environment with a lot of objects in the scene, and my phone is not able to handle them. I think it would be great to control the activation/deactivation of the objects with a script, depending on the player x position: i.e. when x is < 20 deactivate the firsts 15 objects in the scene, and recreate them when x is > 20. How should I do?
Answer by gonzalitosk8 · Feb 10, 2020 at 12:19 AM
What is the function you want?
Did you try using occlusion culling?
Answer by Trumped · Feb 10, 2020 at 03:02 AM
https://docs.unity3d.com/Manual/OcclusionCulling.html
This is a guide on setting up occlusion Culling, this will improve proformance, using batching / color atlases, checking recommended quality settings for mobile and using audio correctly can greatly improve proformance on mobiles.
Your answer
Follow this Question
Related Questions
Camera rotation around player while following. 6 Answers
Activating/Deactivating GameObject Problem :( 3 Answers
Moving objects problem 1 Answer
Reset posiotion 1 Answer
How to keep position of a Game Object when switching scene? 3 Answers