Scripting with Smooth Terrain

I have this puzzle game that involves smooth terrain, specifically water. When a certain thing happens (not saying what; saving the puzzle!), water rises. I want a smooth transition—the water should rise smoothly, sort of like when you’re tweening the size of Parts.

I have a method right now that doesn’t really work because it doesn’t rise smoothly and often just ends up being in the wrong place. There must be a glitch or something. Here’s a snippet of code:

repeat
	print(WG.CFrame)
	WG.CFrame = CFrame.new(WG.CFrame.X, WG.CFrame.Y + 0.2, WG.CFrame.Z)
	workspace.Terrain:FillBlock(WG.CFrame, WG.Size, Enum.Material.Water)
	ait(0.5)
until WG.CFrame.Y >= 6.6

I’m hoping for some kind of alternative or fix. Thanks!

The easiest solution by far would be lowering the room into the water, since as far as I’m aware you’ll always be limited by the minimum block size for terrain, which is quite large.

5 Likes

Pretty much what I was going to say - and with characters on moving platforms now live, you should be able to make it pretty smooth.

2 Likes

Creative solution. uwu

Thanks, guys!