You just duplicate the entire plane model (all of it) and move it, shouldn’t be any issues. Check my WaveExample-4Plane.rbxl model out in the post for an example
By the way, refresh is broken.
Any waves I duplicate are out-of sync. Whereas yours are fine. Solution?
https://gyazo.com/9c130880c9575423a712fce8af2d78ee
P.S I followed the layout of your 4 wave and just added 2 of my own, 5 and 6 (which are both out of sync from the rest)
Hello! This hasn’t seemed to work, the ocean does not move on the duplicated one, it only moves on the original ocean. How do I fix this?
You have to use the module I coded in order for it to work. There is a script in StarterPlayer that initializes the model as a wave, you would have to do the same for other wave models for it to work
HeHello, could you please tell me how to make the character swim on the waves, I have it moving up and down, but this more or less works when the character is next to a bone.
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local PlayerGui = LocalPlayer.PlayerGui
local Backpack = LocalPlayer.Backpack
local Character = LocalPlayer.Character
local HRP = Character:WaitForChild("HumanoidRootPart")
local Hum = Character:WaitForChild("Humanoid")
local Wave3 = game:GetService("Workspace").Wave3
local origPosTable = {}
for i, bone in pairs(Wave3.Plane:GetChildren()) do
if bone:IsA("Bone") then
origPosTable[bone] = bone.Position
end
end
function GerstnerWave(SamplePosition,Wavelength,Direction,Steepness,Gravity,SampleTick)
local k = (2 * math.pi) / Wavelength
local a = Steepness/k
local d = Direction.Unit
local c = math.sqrt(Gravity / k)
local f = k * d:Dot(Vector2.new(SamplePosition.X,SamplePosition.Z)) - c * SampleTick
local cosF = math.cos(f)
--Displacement Vectors
local dX = (d.X * (a * cosF))
local dY = a * math.sin(f)
local dZ = ( d.Y * (a * cosF))
return Vector3.new(dX,dY,dZ)
end
game:GetService("RunService").Heartbeat:Connect(function()
for i, bone in pairs(Wave3.Plane:GetChildren()) do
if bone:IsA("Bone") then
local bonePos = GerstnerWave(origPosTable[bone], 120, Vector2.new(1, 0.5), 0.6, 1.5, tick()/8)
bone.Position = origPosTable[bone] + bonePos
if (HRP.Position - bone.WorldPosition).Magnitude <= 100 then
local v = Vector3.new(HRP.Position.X, bone.WorldPosition.Y, HRP.Position.Z)
Character:MoveTo(v)
end
end
end
end)
The texture of the ocean mesh looks too massive/stretched and not realistic
What I am offering is the code for the wave, the texture I used is from another tutorial, and is purely for educational purposes. If you don’t like the texture, change it, I am just open-sourcing the module and an example.
His texture worked just great for me switching it from a surfaceappearence to MaterialVarient.
I switched to materialvarient but then the textures looked repetitive and weird
I don’t seem to have any issues with them? Did you be sure to switch the MaterialPattern to Organic? On regular you will see massive tiling.
Woah it looks cooler now, but i’m not sure if materialservice is live yet
MaterialService went live in-game few days ago.
Oh, Great! Thank you for the answer, Although one last thing, If there were multiple planes (10+) will the game lag? even tho there is maximum render distance customization in the script? since the creator of this module said 4 planes may lag? Nvm, i just realized these final questions don’t seem to be answered.
Hello, is there any way of adding object floating and swimming to this “ocean”?
If yes then could somebody help me with it? If no then is there a way of doing this any other way?
does anyone have the function to get the height of the wave since im making a boat that will need this
Is it possible to make this ocean infinite? Or is there any way to make it cover more area?
Im not sure, I could code it if I get the time but I’m pretty busy, however I will tell you how to get cracking on making your own.
The skinned mesh I provided contains a ton of squares that each corner connects to a bone. You can get the position on the wave of the height you want to get, get the four bones that the point is inside of, and calculate the height based off of the four positions of the bones.
What you could do is create like 4 or more of these oceans, and as the player moves in a direction, move the fastest wave planes in front of where the player is moving, giving it a chunk loading effect but you really are just moving waves. You do not want to update wave frames every frame to the character of camera position, as that will not move the texture with it (unless there is a way to do skinned mesh texture offset, I can’t remember as I am using the demo wave from another tutorial I linked in the OP).