How to make biomes with TERRAIN

You probably know that we can’t paint terrain colors with same materials, so most the of the developers make a different place for different terrain biomes.

But you can make biomes within the same place using Region3 and Terrain:SetMaterialColor()

Heres a video demonstrating it.

External Media

I’ve used ZonePlus for zones

First, create zones for your biomes by making two parts named Grass and Snow. Disable their collisions and set them to be transparent.

Now create a local script in StarterPlayerScripts and type the following.

local zonemodule = require(game.ReplicatedStorage.Zone)
local grass_zone = zonemodule.new(workspace.Zones.Grass)
local snow_zone = zonemodule.new(workspace.Zones.Snow)

local properties = {
	Grass = {
		{Enum.Material.Grass, Color3.fromRGB(111, 126, 62)},
		{Enum.Material.LeafyGrass, Color3.fromRGB(106, 134, 64)}
	},
	Snow = {
		{Enum.Material.Grass, Color3.fromRGB(235, 253, 255)},
		{Enum.Material.LeafyGrass, Color3.fromRGB(235, 253, 255)}
	}
}

local terrain = workspace.Terrain

grass_zone.playerEntered:Connect(function(player)
	if player == game.Players.LocalPlayer then
		for i,v in pairs(properties.Grass) do
			terrain:SetMaterialColor(v[1],v[2])
		end
	end
end)

snow_zone.playerEntered:Connect(function(player)
	if player == game.Players.LocalPlayer then
		for i,v in pairs(properties.Snow) do
			terrain:SetMaterialColor(v[1],v[2])
		end
	end
end)

and thats it!
I cannot guarantee the performance, but it is functioning well for me personally.

Test it out here:

6 Likes

Hi!

I came across this post very accidentally but this seems pretty awesome to me. Would you be willing to uncopylock the experience? (i also like the night/day effect etc.) Though i guess the code above is already pretty enlightening.
So you could also set the water colour…
so you can set that but not the material variants of course…

this is a funky effect in itself.
hmm im thinkin about how you might make it a more gradual transition…though maybe that’s not possible…

the grass in the other zones also changes colour based on where the player is. is that as intended?

very cool!!!

Biome-Test.rbxl (527.1 KB)

Yes, you can change water color.

What do you mean by that?

Yes, because we are changing the colors of the grass material, the roblox’s decorative grass will change color too depending on the color we provide to it.

1 Like