Finding terrain in Region3

I’m trying to find if there is terrain located in a certain Region3 area before I place a part there. Is there a good method of doing this while not using a fake invisible part with GetTouchingParts() and while not using ReadVoxels() because I don’t want the Region3 to be aligned with the terrain grid (which will move the Region3).

1 Like

I’m pretty sure ReadVoxels does not shift a Region3’s properties at all, given it needs to work based on the Region3 you supply in the first place. Terrain functions are as good as you can get for accomplishing this and the only real way as well to interact with Terrain.

With ReadVoxels() you have to use ExpandToGrid(4) which would alter the position of the region to align with the terrain grid…

Oh, I see. Well, you won’t be able to read terrain voxels any other way though, so you’re kind of anchored to using ReadVoxels if you want to work with Region3. There are obviously other functions out there that are able to detect terrain but only by using their material or checking if Terrain is returned as an argument (for example, a ray function).

FindPartsInRegion3 could be viable, provided Terrain is included in the returned table of parts.

I tested it out before, FindPartsInRegion3 unfortunately only returns baseparts and doesn’t return terrain. I guess I can try and align the parts position with the terrain grid, which would probably be one of the only ways, if not the best way.