Can't print terrain material or color

hello, I have this script and it should print the material of the terrain and the color of the terrain, but it prints this

Capture

and the terrain looks like this

Capture

code

local parts = {}
local RunService = game:GetService("RunService")
local Model = game.Workspace.Model

for i,v in pairs(Model:GetChildren()) do
	v.Touched:connect(function(part)
		parts[i] = part
	end)
end

RunService.Heartbeat:Connect(function()
	for i,v in pairs(Model:GetChildren()) do
		if parts[i]:IsA("Terrain") then
             print(parts[i].Color)
             print(parts[i].Material)
		end
	end
end)
		end
	end
end)

It seems to me that the code is just fine, the top section on the output with all the numbers is probably the color code. And the terrain is a part of an enumeration, It is saying a material even though it may not look like what you want it to print

1 Like

it prints the same with the mud material and it’s the same with base parts if I remove the * if parts[i]:IsA(“Terrain”) then*

Capture

image

Is it printing the same thing? Or are you just looking at what it printed before the mud texture?

1 Like

it’s all the same

Where are you putting this script?

1 Like

it’s a local script in starter gui

That means it could be finding the material and color from the player. Maybe try making it a server script in Terrain

Terrain doesn’t have a Material or Color. It won’t error because Terrain is derived from BasePart, but the individual terrain cells don’t contain this data. So, as you’ve pointed out, they all say Plastic and a grey color, both sand and grass and water.

1 Like

Yeah, you’re right, just tested that out and It doesn’t work