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
5 years ago
Edited 5 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.

01local Terrain = workspace.Terrain
02script.Parent.Touched:Connect(function(hit)
03if hit.Parent == game.Players:GetPlayerFromCharacter(hit.Parent).Character then
04for i = 0,1,.1 do
05wait()
06Terrain:SetMaterialColor("CrackedLava",Terrain:GetMaterialColor("CrackedLava"):Lerp(script.Parent.Color))
07-- 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.
08end
09end
10end)

Answer this question