Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a reason why I cannot lerp terrain color?

Asked by
pingsock 111
4 years ago
Edited 4 years ago

I have typed out the code, this belongs in a local script inside of a part, when the player touches the part, the terrain color lerps to the part's color. Please explain in your answers if you can.

local Terrain = workspace.Terrain
script.Parent.Touched:Connect(function(hit)
if hit.Parent == game.Players:GetPlayerFromCharacter(hit.Parent).Character then
for i = 0,1,.1 do
wait()
Terrain:SetMaterialColor("CrackedLava",Terrain:GetMaterialColor("CrackedLava"):Lerp(script.Parent.Color))
-- line above here is probably too long to be seen but it lerps the returned value for cracked lava's color to the new color.
end
end
end)

Answer this question