Greetings my fellow developers.
About a year ago I released the first version of this project, and I think it’s time to release the second big version.
What’s changed?
The system has been completely re-written, to remove some problems and re-organise the whole code.
This is one of the most important things I fixed in this version:
The overall mechanics have also improved.
Source
About the system
-
Works for both R6 and R15
-
Works with collection service
-
Works for all platforms (
including console) -
Works with all the shapes that work in zone+
-
Only has the swimming property of roblox’s water. If you want to use it with boats too you will need to make that yourself.
-
Handles low fps a lot better than roblox’s water
-
IMPORTANT: Take into account the system is completely client-side. Meaning it could falsely set off anti-cheat systems in your games or if you don’t have these type of systems it could be abused to do things like flying around. Making a server-side anti-cheat is up to you until I have time to do one myself.
How can you set it up? - with the folder method
-
Insert the model into StarterCharacterScripts .
-
Create a folder in workspace, and insert whichever parts you want the players to be able to swim in inside the folder
-
Set the value of “PartFolder” to the folder in which you have the parts:
-
IMPORTANT: Make sure all the parts have “CanCollide” false and “Anchor” true
-
Go to configuration, and set the values to whatever you want:
- CharDensity: The speed in which the character will go up when being idle inside the water.
- CharDensityUp: The same but while the player presses space/buttonA on xbox (this isn’t available on mobile)
How can you set it up? - with the collection service method
-
Insert the model into StarterCharacterScripts .
-
Tag your parts using the collection service default plugin. Use whatever name you want for the tag:
-
Put the name of the tag you used in the string value:
NOTE: if you didn’t understand this short tutorial of how to set up collection service there are better ones in youtube
How does the player use it?
It’s basically the same as roblox’s water except for one thing. For mobile players, the jump button is disabled because of disabling the jumping humanoid state. So, mobile players, to get out of the water, have to tap on the screen, which will simulate jumping.
How does it work?
It’s honestly pretty simple. Firstly, it has different positions located relative to the character. These determine if the character is inside/outside of the water or floating on the surface. Using zone+ I check which of the detectors are inside to find that out.
To make the character swim I disable all the humanoids states that are prioritized before swimming, and to make the character not affected by gravity I use a vector force, applying as force the character’s mass multiplied by gravity (basic physics)
Showcase
- For pc: https://youtu.be/6Gyj29_cES4
- For mobile: https://youtu.be/nGOUUqq-djA
Changelog
- 26/12/22 - Added the posibility to use collection service for the water parts
11/08/22 - Made it actually work on console
TL; DR
Go read the whole post you lazy duck
Thanks. Any support is appreciated
Skinned mesh water will be compatible with this