Beach Water Depth Units not Detected

Anyone know what water depth causes T4 units to basically be invisible to other units? The bug where a T4 is in the water, but most of its body is above the water and it is able to shoot on land units, but cannot be seen or fired back on? Is there a specific water depth that occurs at?

@rama Depends on the height of a unit. Should not be a thing, though. Bad design.

@kilatamoro

Which is what I am attempting to prevent.

Whether the unit is considered underwater is a single point (the root bone, that usually has the name of the unit), where as each weapon determines on its own whether it is underwater. The former is used to determine intel and whether the target as a whole is legit to shoot at. See also the field FireTargetLayerCapsTable in a weapon blueprint. This is a fundamental flaw in how the game works, and sadly it shows up more the bigger the unit is.

From a script perspective, you could check and verify for experimental units that they're not idling near a shore. Occasionally polling every 5 to 10 seconds should suffice. That way users are at least not confronted with this behavior, but you can't prevent users from doing it themselves 😄

A work of art is never finished, merely abandoned

The detection issue is annoying, bit I like microing monkeys and megas to attack shorelines like this. Smart players start ground attacking the location.

The LayerChangeOffsetHeight in the unit blueprints offsets the depth at which the unit is considered underwater relative to the root bone, maybe its value is not ideal for all units.

Looks like a depth of 3.75 or less and T4 units will be visible.

Yeah 3.75 works easily but the tricky part is that if the offset is too much then units will target the underwater unit thinking it is on land, while its hitbox is covered by water (dbg c in console to see collision boxes). I think they start ignoring that unit after they hit the water too.