Continuous Part Script for Infinite Water Part Advice (not using smooth terrain)

  1. What do you want to achieve?: I am trying to create a script that causes continuous water. By this I mean a part that exists everywhere, or seems to exist everywhere, in the map.

  2. What is the issue?: I attempted to create this system using a LocalScript, using the RenderStepped event to move the part to the players current location on the X, Z coordinates, but on the same Y coordinate every single frame. I assumed this would work, and it does, but the effect is jarring. When I walk, it does not appear that I am moving, even though I am, because the part is moving relative to me. I want to know how to create a part that appears wherever I am on the map.

  3. What solutions have you tried so far?: As mentioned earlier, I moved the part relative to the player on the X and Z axes, but not the Y axis. It appears everywhere, but the effect is jarring due to it being relative to the player, and it appears I am not moving.

My script attempting to solve the problem:

local RunService = game:GetService("RunService")
local Player = game.Players.LocalPlayer

local Character = Player.Character
if not Character or not Character.Parent then
    Character = Player.CharacterAdded:wait()
end


local PartDimensions = Vector3.new(2048,1,2048)
local WaterPart = Instance.new("Part")
WaterPart.Size = PartDimensions
WaterPart.CFrame = CFrame.new(Character.HumanoidRootPart.Position.X,0,Character.HumanoidRootPart.Position.Z)
WaterPart.Material = Enum.Material.Foil
WaterPart.CanCollide = false
WaterPart.Parent = game.Workspace

Character.Humanoid.Died:Connect(function()
	WaterPart:Destroy()
end)


RunService.RenderStepped:Connect(function(step)
	WaterPart.CFrame = CFrame.new(Character.HumanoidRootPart.Position.X,0,Character.HumanoidRootPart.Position.Z)
end)

What the jarring effect looks like:

Effect I am looking for (from Tradelands):

A game that has similar mechanics to what I am describing here is the game Tradelands: Tradelands - Roblox

Thank you for reading – I hope someone has a solution in mind for my water effect. :slight_smile:

2 Likes

I’d suggest just making an extremely large part that actually does exist everywhere. Perhaps connecting multiple 2048x2048 stud parts. Considering your script manually moves the part everywhere, performance wise, this would be the better solution.

If you’re convinced you need a script, you could write a script that keeps the part in place, and detects when the player is nearing the edge, duplicating the part, and when the player crosses that threshold, deletes the old part. Basically a very simple chunk system.

2 Likes

Sounds like a way to solve my problem! I will add a series of parts in a square 1 “chunk” away from the player, this way they don’t see the edge. Thank you!

2 Likes

The texture should be repeating, so find out how many studs it takes for it to repeat, and then round the coordinates to the nearest repetition.