Swimmable part. High performance water

It’s in the place in the post.

WOW… this is amazing! I don’t like Roblox’s terrain water because of its look. I will make use of this!

3 Likes

Is it possible to make this work with unions?
I’m asking since when I try to add water barriers
or something to my game the shadows aren’t
that good but with parts it’s easier since you could disable
shadows for it.

3 Likes

Look into ZonePlus v2 to detect if a player is inside the water union.

It will be less efficient however, but that shouldn’t matter to much since this is all client-side.

2 Likes

AMAZING WORK! Ive always needed something like this for my builds but never had the scripting skill to make it, Thanks so much and keep up the amazing work!

2 Likes

I found another bug @gpm231 , and this seems a little more critical…

When a player equips a tool any time before entering the water, and then unequips before entering the water, and re-equips the same tool inside the water, it will teleport them all the way back to the spot where they last equipped the tool. It seems to be happening with Motor6D affected tools and regular tool handles as well

Not sure if this is an easy one, but this glitch only happens in the swimmable part water

3 Likes

I’m no expert, but I believe this script runs on the client-side. That may have something to do with the issue.

1 Like

That’s very probable, but due to Network Ownership, the server isn’t really responsible for player movement as the client gives the server that information.

(hence why when your client freezes, the server sees that the player froze and they appear frozen in game, similar to players moving slower based on their framerate)

Real roblox water works in a very similar way.

Only, I got no idea how to fix this on my own.

2 Likes

is there any way to add custom animations for it?

2 Likes

I think you can, but I am not sure. The only way a think this could be done is by making your animation have the highest priority and playing it when the player enters the water and stopping it when the player leaves the water.

I have tried many things to fix this, but nothing worked. This must be a roblox bug because the server knows the player is in the water, you can see that when you test it in studio with the server tab opened.
Im gonna keep thinking ways of fixing this, but it will take me time.

2 Likes

I figured it was a bug. Nothing in your code looked like it could have caused anything like this sort of thing. I would make a bug report or ask someone to make a bug report and include the things that you used to make this system. There must be a way around somewhere to get this to properly work. Thanks for trying!

2 Likes

Awesome! Roblox needs to take notes on this. :laughing: It seems that you swim pretty fast in the water, at least in the test game. I recommend slowing down the swimming speed if you can.

1 Like

New update. While I was working on fixing the tool bug I came up with a new detection system.

6 Likes

Do you mind updating the guide? I think the current one is outdated.

2 Likes

It’s not outdated, if you have any trouble setting it up, you can ask me in dms.

1 Like

I don’t really understand how to add this, can you give a better tutorial? so I can understand this so I can add this to my game, thank you

Edit: Okay, sorry my bad, I was able to add the water in my game but I suggest you to give us a better understanding how to add this, thank you and stay safe

2 Likes

does this also support parts?
Having the ability for parts to float on the water would be nifty

2 Likes

No, it doesn’t support parts, but you can make a custom system with vector forces to make a part kinda stay on top of the water

1 Like

Unsure if the latest update fixes this issue (it might but I don’t see this bit of code at the top to help combat this issue)

but it appears that Roblox games with a lot of content will actually prevent the water from working at all until the user resets. Some people will swim, and others will end up walking as normal because the script loaded before they fully loaded. To fix this issue, I recommend adding this:

if not game:IsLoaded() then
    game.Loaded:Wait()
end

to this section here, inbetween your credit and the variables

--Contact:
-Roblox: gpm231
-Twitter: @gpm231RBLX
-Discord: gpm231#9505
--]]

-- Wait for client to fully load in assets
if not game:IsLoaded() then
    game.Loaded:Wait()
end

local conActSer = game:GetService("ContextActionService")
local colSer = game:GetService("CollectionService")
local lighting = game:GetService("Lighting")

I know developers can easily add this in, but it would be awesome if you featured it by default. It doesn’t seem to cause any issues in the long run of things, and it 3 lines of code extra. Then again, your choice!

1 Like