How would I replace terrain material from grass to snow in a big map?

Hello,

I am trying to convert my terrain map from a Summer Theme to a winter theme.
Only issue is, if I use terrain tools it would take ages to replace the grass with snow and ice. So how would I go about this with scripts?

I have found similar topics but neither of them had the answer I was looking for.

It says the terrain region is too big.
It is possible with a Loop but I dont know how I would go about it.

Thanks in advance.

1 Like

I think you can go to terrain editor and then select a region of terrain then replace it with another terrain

Edit: If it is too big, you might want to do it multiple times at a smaller scale

There is a lovely Terrain::ReplaceMaterial
https://developer.roblox.com/api-reference/function/Terrain/ReplaceMaterial

Here is some code you can run in the command bar:

local WorkspaceService = game:GetService("Workspace")

local Part1 = WorkspaceService["1"]
local Part2 = WorkspaceService["2"]

local Region = Region3.new(Part1.Position, Part2.Position)

Region = Region:ExpandToGrid(4)
WorkspaceService.Terrain:ReplaceMaterial(Region, 4, Enum.Material.Grass, Enum.Material.Snow)

Create a part in workspace named 1 and put it in the lower region of the grass you want to replace. Then create a part named 2 and put it in the higher region. Then run the code. All grass between the region will be replaced with snow.

Here is a video tutorial: (I have been waiting like 20 minutes for this to upload :roll_eyes:)

6 Likes

You can also find the terrain object under workspace and change the grass color property to white, Iā€™m not sure if that will look good or not though.

1 Like