I'm trying to make a game where there's different underwater biomes and every time you enter a new one, the water changes color. I've tried Color3:Lerp() and Tweens, but none work and break the script. Could someone help me on how to change the color smoothly?

local tween = TweenService:Create(workspace.Terrain.WaterColor, transitionInfo, {WaterColor = Color3.fromRGB(22, 36, 113))})
	tween:Play()

or

workspace.Terrain.WaterColor:Lerp(22, 36, 113)

3 comments

0

The first option seems perfectly fine, what is the issue you're having with it? The Lerp part would need to be on some sort of loop, since the 2nd argument of Lerp is the alpha (from 0 to 1, 1 would be full transition, .5 would be half).

0

ah ok I see now, the problem was that the lerp wasn't on a loop, just a function.

0

Oh, also turns out your Tween function is slightly incorrect. You should be editing the Terrain instance, not the Terrain.WaterColor property.