# Realistic Ocean Waves

I’m trying to make a showcase game with a beach theme. I’m having quite a lot of trouble with the waves. If you have ever been to the beach or seen a video of Ocean Waves, you’ll know what I’m trying to do.

As a more specific explanation: I’m trying to make a system where the waves overlap each other. For example, they start off as a lump in the water, then as they draw closer to the shore, they rise up and foam begins to build up. Then, when it hits the shore, the wave dissipates and foam moves up onto the beach. You can see what I’m talking about in the link above.

Now I’m wandering, how would I do this in Roblox? Here’s a few things I thought up:

1. NOT using terrain water. It just doesn’t look or act like water.
2. Possibly a mix of mesh deformation and particles.
3. Mesh deformation and the new Particle Flipbook system.

I was wondering what ideas others may have and methods of doing this.

3 Likes
``````local X,Z = 25,25
local Parts = game.Workspace:FindFirstChild("Parts")

if not Parts then
Parts = Instance.new("Folder")
Parts.Parent = game.Workspace
Parts.Name = "Parts"
end

local Intensity = 50
local Smoothness = 200
local Size = 4
local YSize = 40 -- The size of the object on the Y Axis
local YOffset = 25 -- Distance between the 0,0,0 and the parts
local Seed = 1 -- Variations
local Speed = 1 -- Speed of the Animation

local function MakePartWithColor(Position)
local Part = Instance.new("Part")
Part.Parent = Parts
Part.Anchored = true
Part.Position = Position
Part.Size = Vector3.new(Size,YSize,Size)
Part.Color = Color3.fromRGB(87,127,167)
Part.Material = Enum.Material.Glass
Part.Reflectance = 1
Part.Transparency = 0.5
end

local function Tween(o,d,g)
local es = Enum.EasingStyle.Linear
game:GetService("TweenService"):Create(o,TweenInfo.new(d,es),g):Play()
end

for x = 1,X do
for z = 1,Z do
local Position = Vector3.new(x*Size,YOffset,z*Size)
MakePartWithColor(Position)
end
end

local gobackwards = false

while true do
for i,v:Part in pairs(Parts:GetChildren()) do
local x,z = v.Position.X,v.Position.Z
local y = ((math.noise((x+Seed)/Smoothness,(z+Seed)/Smoothness) * Intensity)+YOffset)
Tween(v,Speed,{Position = Vector3.new(x,y,z)})
end
Seed += 1
wait(Speed/100)
end
``````

this one isnt that good but it looks realistic to me

2 Likes

What does this do exactly? Could I have some context?

Although i like @Qinrir suggestion, i don’t feel that is the look you are trying to achieve (but this is an excellent choice for map exteriors and distance shots, looks great!).

I also don’t have a solution because I have tried to achieve this too in the past and never found anything close other than in this game, just go to the beach part and see those waves:

https://www.roblox.com/games/735030788/Royale-High

I would have no idea how to start on that even, but maybe this will give people an idea?

Just tested this, and while it is nice, it isn’t really the effect I’m looking for, and it also destroys performance.

From what I see, it’s just terrain water, a particle effect, and some billboard guis

Someone did a skinned mesh water and it looks fabulous. That wasn’t for beaches though.

For beaches, would try to run several concurrent animations and let the Roblox engine sort out the blending.

The tides would be simulated by a rising and falling water mesh. A lumpy sandy beach would make the tide look natural.

The white foam could be a secondary mesh peeking out from under the water mesh. The spray from water hitting rocks could be strategically placed emitters, activated by animation events.

Bottom line, you are going to need a really good artist and coder to do it this way. Good luck!

2 Likes