Character swimming

Swimming on the water surface works similar to buoyancy except there's only one point that reads the wave data (typically located at the character's chest). Explore BP_DemoCharacter for better understanding how swimming works.
Core functionality is defined in the BP_WaterSurfaceSwimming component that is attached to the character.
Diving under the water currently is not implemented. It introduces a set of challenges related to animation and character rotation, so it was left for future updates. You can see the initial attempt of making it dive in the even graph in the Movement Input section.
The demo character switches from swimming to walking states by checking the overlapping actors around the feet area and for that to work they have Generate Overlap Events set to true.
Post process control rig is skipped in the character animation graph when the character swims, since it snaps the feet to the ground whenever there's something close to the feet.
Character gravity direction is updated accordingly. You might experience character rotation issues when away from the North Pole of the ocean sphere.
Swimming is experimental and is subject to change, but in its current state gives you a good starting point.
Currently swimming does not take into account waves attenuation feature since distance field is only accessible on GPU. That means a character will swim near the shoreline assuming waves have full strength there, although they are faded out using distance field. This might be fixed in the future by introdusing a distance field approximation on CPU using line or sphere traces.
Last updated