what is the most optimized method to create a big ocean? my current method is creating a big water block on the players X and Z position on the ocean level, but im not sure if that is a good method
heres my current script
local terrain = workspace.Terrain
local REGIONS = {}
for i,v in pairs(game.Workspace.AntiWater:GetChildren()) do
local antiwaterregion = Region3.new(v.Position-Vector3.new(v.Size.X/2,v.Size.Y/2,v.Size.Z/2),v.Position+Vector3.new(v.Size.X/2,v.Size.Y/2,v.Size.Z/2))
table.insert(REGIONS,antiwaterregion)
end
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function()
local oldregion
while wait(2) do
local char = plr.Character
local hrp = char.PrimaryPart
if hrp.Position.Y < 500 and hrp.Position.Y > 200 then
local middle = Vector3.new(hrp.Position.X,237.313,hrp.Position.Z)
local cylregion = Region3.new(middle-Vector3.new(500,19,500),middle+Vector3.new(500,19,500))
if oldregion ~= nil then
terrain:ReplaceMaterial(oldregion,4,Enum.Material.Water,Enum.Material.Air)
end
terrain:ReplaceMaterial(cylregion,4,Enum.Material.Air,Enum.Material.Water)
oldregion = cylregion
for i,v in pairs(REGIONS) do
terrain:ReplaceMaterial(v,4,Enum.Material.Water,Enum.Material.Air)
end
end
end
end)
end)