Preventing Camera From Looking Underwater with Popper Module

I’m trying to manipulate the player camera through the popper module so that it is unable to look underwater.

Starterplayer > StarterPlayerScripts > PlayerModule > CameraModule > ZoomController > Popper

I semi-achieved this on line 200 (I have a transparent/no-collision block named CameraBarrier even with the smooth-terrain water’s surface):

if canOcclude(entryPart) or earlyAbort or entryPart.Name == 'CameraBarrier' then

This works while the player is idle at the surface of the water, however, while swimming the character model dips below the barrier and allows the camera to look below since it is now located within the barrier and becomes exempt from the occlusion check as a result.

Any ideas on how to better approach this?

1 Like

Having the exact same issue right now. Tried CameraOffset which didn’t work, and I can’t think of another way to do it :person_shrugging:

1 Like