I have a game with a few Character BP pawns and the player can switch control between each one. The other characters follow the controlled character by switching their controls to AI and having them do a Move To Location Or Actor with the player’s controlled actor.
The characters have different buoyancies, some float (b=1.5) and some sink (b=.95). Under control, they float or sink fine and “IsSwimming” is correct. This is using a regular physics volume that has Water Volume set and a fluid friction of 0.35
However, when I first switch to a pawn that has followed another pawn into the water, “IsSwimming” is false even if they are in the water. This isn’t a terrible bug, but the next one is –
The sudden switch from AI controlled without IsSwimming to controlled and (at some stage) finding itself in water, produces a weird inverted-buoyancy teleport: if I switch to the pawn that is under water, it will teleport to above the water! It doesn’t even move there, it appears there. The pawns with b=1.5 exhibit the reverse – they suddenly move further underwater and bob back up. Once I’ve switched to them and IsSwimming is set correctly, switching between them works fine.
This only happens when they move into or out of the water under AI control, such that IsSwimming isn’t set correctly. I tried seeing if I could force a recalculation of IsSwimming by teleporting to the same or a nearby spot, but that didn’t seem to work. And I can’t seem to set the variable manually.