6 min read
Introducing the Swimming System in V2.0 – Expanding Gameplay Below the Surface

Version 2.0 of the Modular Third-Person Framework introduces one of the most anticipated mechanics: a fully modular Swimming System. Designed with smooth transitions, camera-driven movement, and full integration with stamina and breath mechanics, this system extends gameplay into water environments with minimal setup. 


🌊 Seamless Transitions In & Out of Water. Swimming is not an isolated state — it’s part of the unified movement architecture. 

  1. Entry: PlayerEnterSwimState detects submersion ratio (via SwimConfig) and switches to swimming when the player is sufficiently underwater.
  2. Exit: PlayerExitSwimState allows climbing out via ledges, shorelines, or climbable objects.
  3. Integration: All states inherit from PlayerMovementBaseState (which implements IPlayerState), ensuring consistent transitions across climbing, parkour, and swimming.

 How could you extend this system to support stealth or underwater combat mechanics? 


🎥 Natural Camera-Driven SwimmingMovement follows the camera, not rigid input directions. 

  • PlayerSwimState calculates buoyancy using water surface Y, bottom Y, player height, and submersion values.
  • Motion feels fluid whether floating, diving briefly, or treading water.
  • Rotation math ensures stability and prevents jitter during real-time orientation adjustments.

💨 Stamina & Breath IntegrationSwimming ties directly into gameplay systems: 

  • Stamina: Configurable in StaminaConfig. Normal swimming drains stamina slowly; fast swimming increases the drain.
  • Breath: Managed by the standalone Breath System. Surfacing regenerates breath automatically. Tunable via BreathConfig.
  • Events: Changes broadcast via delegates for easy UI binding.

 Which survival mechanics could benefit from this stamina-breath integration? 


🌐 Water Volume DetectionSetup is simple: 

  • Add the WaterVolume script (Interaction layer) to your water object.
  • The collider defines boundaries; depth is auto-calculated for submersion detection.
  • No glue code needed — the system ties directly into the movement state machine.


🧗‍♂️ LedgeObject – Smooth Swim ExitsSwimming exits are polished using the LedgeObject: 

  • Attach a LedgeObject to exit points.
  • The system aligns the player’s position to the ledge, preventing awkward clipping or drifting.
  • Shared across climbing and swimming for consistent exit behavior.


⚙️ Config Spotlight – SwimConfigFine-tune swimming via the SwimConfig ScriptableObject: 

  • Swim speed and acceleration
  • Buoyancy strength and thresholds
  • Timeouts for entering/exiting swim states
  • All parameters are runtime-editable for rapid iteration


🧠 Architecture Overview 

  • MonoBehaviour: PlayerCoreOrchestrator – orchestrates logic for all states
  • States: PlayerEnterSwimState, PlayerSwimState, PlayerExitSwimState
  • Interaction Components: WaterVolume, LedgeObject
  • Configs: SwimConfig, StaminaConfig, BreathConfig


 Quick Setup Checklist 

  • Attach a WaterVolume collider to your water object
  • Place LedgeObject components at swim exits
  • Create and configure a SwimConfig asset
  • Wire stamina and breath systems (optional but recommended)
  • Test entry, exit, and buoyancy thresholds in play mode
  • Adjust Animator blend times to match swim clips


🎞️ Notes on Animations The framework is code-only. Developers should: 

  • Import production-ready swim animations
  • Map clips in the Animator (recommended: sub-state machine for Swimming)
  • Sync timeouts with Animator clip lengths for smooth transitions


🧩 Final Notes The Swimming System in V2.0 expands the Modular Third-Person Framework into water environments with seamless integration. With camera-driven movement, ScriptableObject-based configs, cross-system compatibility (stamina, breath, parkour, climb), and polished LedgeObject exits, swimming becomes a plug-and-play mechanic that feels both natural and production-ready.


👉 Get the Modular Third-Person Framework on the Unity Asset Store: https://assetstore.unity.com/packages/templates/systems/versatile-third-person-controller-system-281833
👉 Already using the framework? Share your experience — leave a review here: https://assetstore.unity.com/packages/templates/systems/versatile-third-person-controller-system-281833#reviews

👉 [Documentation Hub – High-Level Overview + System Architecture]: Unity Game Development Docs | True Tactical Studio


Comments
* The email will not be published on the website.