How to only show objects in range ?

Lets say I have generated a terrain with chunks, and want to only make the chunks visible that are in a view range.

There is a piece in my code that already cuts down the player position to which chunk it is on, the position (1,3) for example on the similar chunk, and (0.1,4 for somewhere on the x axis on the first and on the fourth chunk on the y axis.

But now I run into issues with for loops and integers, because making a float to integer does value loss, and every value needs to be converted . I want to know a better way of doing this, perhaps something built in ? Its basically for performance, and hiding / showing GameObject things.

You can tweak with camera range values & Occlusion Culling also.

You could use Level of Detail (LOD Groups), reduce it to two groups and leave the renderer for the second group empty. That should give you easy control over the visible distance and it is is automatically adjusted by the the selected quality settings.