Character keeps switching to falling when on water surface

Hello Forums.

First I should show you what I’m working with:

Using a Buoyancy component, I have made my character able to enter swimming mode and exit into walking mode. I’m using the UE water plugin for the water bodies. This part works perfect.

The problem is, when I reach the surface of the water, the character keeps switching between falling/swimming mode and causes a lot of jittering.

How could I make the character stop doing this and just stay level with the waterline?

Things I Have Tried:

In the water body, I tried adjusting the “Collision Height Offset” this did not appear to have any effect.

Disabling jumping while in water and setting OutofWater Z to 0, 100 and even -1000

Hey there @Z3R0K0! Depending on how you want the player’s interaction with water to go, swapping to the Falling state is somewhat expected. I would personally try to make a “Cooldown” between certain state transfers, so for maybe half a second after leaving the water the state doesn’t change, the state can attempt a change. This should be instantly overridden if the character touches the ground.

I hear what you are saying, but I don’t know how to do it. Could you show me somehow? It would be much appreciated

Managed to achieve this by taking an example from loco dev



1 Like

My apologies, I had left the office after my previous response. Looks good, a surface swimming state is one way to solve it. I’d recommend testing for edge cases like high speed ejection from the water as well.

Did your fix resolve the issue entirely?

1 Like

It works quite well, but I have started working on something else so I’m not going to go any further for now. Its probably easier and less time consuming to buy a swimming system from fab.

But yes, it did fix the issue I was having. I posted the blueprints here in case someone wants this information in the future.

1 Like