How can i make my game lag less?

So im making a game and im using all cubes. I would like to make it so it shows all of the cubes in the trigger of the player but then it doesnt render the other ones. Or something along those lines. Can anyone tell me how to do this? Thanks!

1 Answer

1

All you have to do is set the renderers (and colliders perhaps) off by default. When the the objects enter the ‘trigger of the player’, then turn their renderers/colliders on. When they exit, turn them back off.