Swimming problem with large waves

JMab

New member
Hi, I have a bit of a tricky problem with the swimming pack. I have my Water Height Detection set to Custom, and a script attached to may character that gets the water height level each frame and calls swim.SetWaterSurfacePosition(). This mostly works - the swimming character rises and falls with the waves. However, for some larger waves, the character actually rises so high it leaves the collider, which calls OnTriggerExit() of the Swim ability, triggering a short fall animation followed by the character continuing to tread water or swim. Any ideas to fix this without just reducing the size of the waves?
 
JMab, I just struggled through this same scenario. It's a little ambiguous to me the interplay between the collider and the manually-set Y position. I found in my testing that setting the collider to the maximum wave Y worked. That way, when the player enters the collider, they're within the range the water *could possibly be* and then Opsive looks to the Y position you've set manually to determine whether they're actually in the water or not. No guarantee, but it worked for me.
 
Looks like I missed this post. Andrew's solution is a good one. You could also change the trigger height to the max wave height after the character enters the trigger so it's not huge when the character isn't inside it.
 
Hi both, I finally got back to this after working on different parts of my game. Setting the collider to the maximum wave Y worked, thanks Andrew.

I'll implement your additional tweak Justin if needed, thanks.
 
I am using the Crest ocean system, and I had to increase the surface buoyancy amount to 0.5, as otherwise the character constantly started the underwater animation / dive from surface. Did you change anything else?
 
Top