How to detect which terrain material does the part touch?

How to detect which terrain material does the part touch?

Maybe Terrain.Enum.Material.LeafyGrass ?
Will it work?

terrains are voxels so like what u might be able to do is like assign a invisible part for the mesh and have a tag for it specifying what its material it descended from. from there your next step would be finding how to make the voxels non collidable. You could probably be sneaky and do some aabb math but I think thats just adding more problems

1 Like

Ok, thank you for a suggestion :slight_smile:
But I have a question, what are voxels?

fancy name for cubes. No but in reality it’s just a name for values within a grid. So like

{
 0,0,0,0,1,
 0,1,0,1,0,
 0,0,0,0,1,
 0,1,0,1,0,
 0,0,0,0,1,
 0,1,0,1,0
}

this could represent like walls in a 2d game. Where 1 represents a wall or “cube” in a sense. Each one of these elements in the table are voxels. It just happens that in 3d graphics we associate them with cubes. Also that was a 2d example, in 3d I am not sure on their data structure but its probably a tensor.

1 Like