I’m trying to fill in a swimming pool with terrain water using Terrain:FillBlock(), and when I do so the terrain water is way out of alignment and it’s just too curved
Terrain works by using voxels. You can think of voxels as pixels on a 3d grid. Each voxel is a 4x4x4 volume, strictly aligned to the voxel grid. Because of this, when you use a method like :FillBlock(), you will be roughly converting a shape onto the voxel grid. The blocks will need to line up with the grid in the same way if you want the results to be consistent.
One ways to make sure that the water is always as you expect would be to use a waterblock that has sizes on each axis that are multiples of 4. And you’ll need to make sure that the corner of the blocks line up with the voxel grid, by checking the position.
I see now that the inconsistency occurs for parts that are not aligned to the voxel grid, but why does the terrain in the first image look so off despite the part being aligned to the voxel grid?
Is it possible for me to consistently achieve the look in the second image? Because that looks much better
Why aren’t you just using the Region tool to Select a voxel grid of where you want to add the Water?
Then use the Fill tool with Water as the Material.
Or is this for placing models of this pool around the map at different Positions?
in the first photo, the part does describe the voxel grid. You can tell because the corner is flush with the “corner” of the water, the reason the water sticks out it because its animated/smoothened to bulge out a little bit so the water has no sharp corners. At least, I hope so.
Is your script calculating the Position of the Part?
In that case it may be possible that the location calculated is right on the border of the X,Z grid location of the Part and decimal rounding makes the difference.
Computers suffer from floating point error, so calculations may be off by tiny amounts.
For an example lets use a 4x4x4 cube as the template for where you want your water: (I can’t remember how the Terrain studs are centered, but lets say the middle of the Terrain voxels is 0,0,0)
If your ‘template’ Part is located at 0,0,0 then the voxel will show up at that point.
But let’s say the template is at 2,0,0. If there is any variation of that location by say + or -.000001 studs the voxel system will round up or down to the 4x4x4 grid.
When the actual number is 1.999999,0,0 then the voxel will be placed at center.
When the actual number is 2.000001,0,0 then the voxel will be placed at 4 studs off center on the X axis.