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).
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.
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 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.