Water System: Polishing Needed

I’ve seen people asking how to make a Part/Block that players can swim through like water, and made my own system for myself. For the most part it works, but it needs polishing, and I’m not sure how to fix some of these problems.

The system is made from a Region3 script that changes a BoolValue within the player when they enter/leave the water part. Another script then triggers a function that toggles the player’s ability to fly/swim around in the part whenever the BoolValue is changed.

Here’s a model of the scripts: PartWaterSystem.rbxm (4.6 KB)

One problem is that when the player enters the water from the ground, they aren’t able to swim upwards or downwards until they swim away from the floor and are directly above an area with no ground. Example:

So far, I’ve considered that something isn’t letting the player move up or down because the game thinks the player is still walking around normally, and won’t let them move vertically until the player starts falling. (I’m not entirely sure if this is the problem)
Any ideas?

when the player enters the block you can change the humanoid state to falling that might be a fix.

the problem seems to have something to do with disabling the running state when swimming, I removed the line disabling the state and it works as intended. a print of the current state while swimming with running disabled shows that the RunningNoPhysic state is constantly active when walking into the water region

4 Likes