Hi. I recently played a game called Fishing Simulator, which contains amazing waves and ocean physics. After searching everywhere about this, I figured out this effect was created using beams, so I set out to create an algorithm to do this. It is just nodes ordered in a grid, and I attached beams between each of them. It created this when moving the nodes around using the move tool:
This, however, is not the intended result. The intended result is the video in this post:
It turns out his example eluded me to how the beams actually worked, and caused me to believe that beams would sort of triangulate in between multiple attachments, but once I actually created the system, I had been proven wrong.
local WaveNodes = game.Workspace.WaveNodes
local WaveWidth = 10
local NodeRows = {}
local OceanSize = 10
-- Creates nodes
for x = 1, OceanSize, 1 do
local Row = {}
for z = 1, OceanSize, 1 do
local Node = Instance.new("Part")
Node.Name = tostring(x).."-"..tostring(z)
Node.CanCollide = false
Node.Anchored = true
Node.Orientation = Vector3.new(0,0,-90)
Node.Size = Vector3.new(1,1,1)
Node.Position = Vector3.new(x*WaveWidth,1,z*WaveWidth)
Node.Parent = WaveNodes
local Attachment = Instance.new("Attachment")
Attachment.Parent = Node
Row[z] = Node
end
NodeRows[x] = Row
end
--Creates beams between nodes
for x = 1,OceanSize,1 do
for z = 1, OceanSize-1, 1 do
local Beam = Instance.new("Beam")
Beam.Parent = NodeRows[x][z]
Beam.Attachment0 = NodeRows[x][z].Attachment
Beam.Attachment1 = NodeRows[x][z+1].Attachment
Beam.Color = ColorSequence.new(Color3.new(0,170,255))
Beam.Width0 = 10
Beam.Width1 = 10
Beam.Enabled = true
end
end
Is there any way I can connect these nodes that I generate within my script in a way that causes beams around them to be affected in both directions, as seen in the prior example. As these are only connected on a strip by strip basis, I believe this is why this occurs.
Here’s a video of how the water is generated (each strip generated at 0.1 second intervals to make viewing possible):
The intended result was made by @ScottyMcPiper, maybe he can help me in this situation? If he doesn’t, I’ll try mentioning the creator of Fishing Simulator.
I know this was a long thread, but I had to show all the steps I had done to get to here, thanks for reading, and any support on the issue is appreciated, as I want to get this ready for a game.
Edit: I realize several threads have been made about similar topics