For example, say you want to limit the playable area to a 200x200x200 box around zero world position (0,0,0):


1. Select FPSController and disable "Start On Flat". By default, this option will spawn the player on a flat and random position. The random position depends on the world seed. So it will only change if you change the seed. Note that Voxel Play will always spawn the player on top of the surface.


2. Move the FPSController position to (0,0,0) using the transform position fields in the inspector.


3. Scroll down and tick the "Limit Bounds Enabled" checkbox and enter the playable area size in the Limit Bounds fields.


That's it!

Step by step video:





Also, if you don't want to render any chunk beyond the extents area, you have 2 options:


1. Recommended: uncheck the "Infinite" toggle in the World Definition fields and set World Extents to 200x200x200 in World Definition:



2. Or you can add this script to FPSController gameobject which basically overrides the chunk contents with empty voxels:


using UnityEngine;
using VoxelPlay;

public class LimitArea : MonoBehaviour {

    VoxelPlayEnvironment env;

    void Start () {
        env = VoxelPlayEnvironment.instance;

        env.OnChunkBeforeCreate += (Vector3 chunkCenter, out bool overrideDefaultContents, Voxel[] voxels, out bool isAboveSurface) => {
            const float MAX_DISTANCE = 100;
            float dx = Mathf.Abs (chunkCenter.x);
            float dy = Mathf.Abs (chunkCenter.y);
            float dz = Mathf.Abs (chunkCenter.z);
            if (dx > MAX_DISTANCE || dy > MAX_DISTANCE || dz > MAX_DISTANCE) {
                overrideDefaultContents = true;
                /* Here you could provide your own voxels setting the voxels array for the chunk which is 16x16x16. If you don't provide any voxels, the chunk will be empty */
            } else {
                overrideDefaultContents = false;
            }
            isAboveSurface = true;
        };
    }
     
}