Changing Terrain Materials

I am making an open-world persistent building game, and an issue I have run into pretty quickly is Grass in ROBLOX.

Specifically, being able to remove grass when you place an object down.

I am aware of the function in the documentation to ReplaceMaterial, however I am struggling to figure out how to best implement this into my game, and make it persistent. And by persistent, I mean that buildings will be saved and loaded via datastores, and I would need the terrain to update every time those buildings are loaded so we don’t have grass sticking up through the floors of those buildings, so I just need some kind of reliable way to create region3’s and then somehow figure out how to save and load them, I think.

I have considered using a tool that places down parts so a player can manually cut the grass away or create paths, which would be the easiest route probably, but I would be concerned about how to deal with making sure that the player places those parts on the proper grid as described in the documentation.

Perhaps there would be a way to create a Region3 around a model/building, and use that to change the material of the terrain? I am not sure…

I’m not necessarily looking for code, but moreso just ideas about how I could effectively implement some kind of system like this. Ask questions if you need more specifics and I’ll try to clarify the best I can!

1 Like

Maybe you can have your placement system work on a 4 x 4 stud grid, and by doing this you can consistently set the materials around the building you place.