How do i mask the water line inside of my submarine?

Hi there, i’m currently making a stormworks type game but i’ve stumbled across a problem: Water. As everyone knows roblox’s water physics is quite shitty and the water level is visible inside of a enclosed space (See image).

This is what i’m trying to achieve:


As you can see the water surface is not visible inside of the ship, this is what i want.

Does anyone know how to circumvent this issue?

Note: I might also switch the terrain water out for custom water with mesh deformation, but i’d still need to mask the water line inside of a ship.

3 Likes

Unfortunately, There currently is no way to achieve this with terrain water as far as i’m aware.

1 Like

I dont know if this will help you but i remember a months ago i saw a topic about making a terrain via script, the man kept swimming in the air wherever he walks a water terrain is generated into his position and once he leaves his position the water disappears. (The water was terrain not part/mesh)
I think you can do the same but vice versa, wherever the submarine goes the water disappears, and once it leaves the water is back… I hope that i helped you, i will try to get that topic for you.

2 Likes

Would this be possible with part water?

1 Like

Kon’nichiwa! :bowing_woman:t2:
SOLUTION :one:
Removing the terrain around your ship and filling it in using a loop.

This does exactly what I think you want to do. You can tweak it to your needs, and it can become a bit taxing.

local Boat = workspace.Boat
local Terrain = workspace.Terrain
local ClearWater = Boat.ClearWaterPart

local LastCF, LastSize = ClearWater.CFrame,ClearWater.Size
repeat wait()
	if ClearWater.CFrame ~= LastCF then
		Terrain:FillBlock(LastCF, LastSize, Enum.Material.Water)
		Terrain:FillBlock(ClearWater.CFrame, ClearWater.Size, Enum.Material.Air)
		LastCF = ClearWater.CFrame LastSize = ClearWater.Size
	end
until workspace:FindFirstChild("Done")


Downsides:

  • -Makes little bumps in the water since roblox’s voxel fill is sometimes not that accurate.
  • -Requires that the ‘ClearWater’ part is always perfectly level with the rest of the terrain water.

SOLUTION :two:
Use an illusion.
Make a ship model exterior and make a ship model interior as a separate model which the player is teleported to seamlessly if they go below deck.
Have certain effects replicate to sell the immersion/illusion. Such as shaking when the main ship model gets hit, replicated sound effects of the things going on around the main ship model, etc.

You can try using ViewportFrames in the windows or specific doorways to aid in the illusion.

6 Likes