Project requirements, water dimensions, camera projection, and initial setup.

Requirements

  • Unity 6 and URP with the 2D Renderer.
  • Orthographic gameplay camera facing positive Z with zero rotation.
  • Compute shader support for wave simulation.

Create a Water Source

  1. In Unity, choose Tools → Modern Platformer Water → Create water….
  2. Assign the gameplay camera, set the dimensions, and click Create water source.
  3. Add Water Object to each SpriteRenderer that should interact with the water.

Dimensions and camera

Water Source · Water & camera setup · Dimensions and camera

SettingEffect
WidthReservoir width before Transform scale; changes the physical X bounds.
Underwater depthDepth below Y0 in physical Y units; moves the bottom without changing virtual Z.
Waterline heightWorld Y offset added to Transform Y to define physical waterline Y0.
Surface reachReservoir length in virtual Z world units. Normalized sprite depth spans 0 to this value.
Surface vertices X32–2,049 vertices across the water width. Enter 0 for automatic resolution.
Surface vertices Z4–257 vertices from front to back. Enter 0 for automatic resolution. A manual count on either axis replaces local mesh refinement.
Perspective row spacingUse the source perspective distance to preserve front detail and spread rows toward the rear. Reduces render geometry independently of the solver.
CameraOrthographic gameplay camera that defines water perspective. Scene view uses the assigned camera for its water preview.
More dimensions and camera settings
SettingEffect
Keep original size atFar keeps the far waterline fixed and projects near objects towards the camera. Front keeps the front waterline fixed and projects the far waterline away.
Custom size-lock depthCustom size-lock lane: 0 is front, 1 is far. This lane keeps its authored XY position and size.
Perspective distanceVirtual camera distance in world units. Larger values reduce parallax and perspective.
Width measured atChooses which surface edge the authored Width describes. Near and far edge widths can differ under perspective.
Camera framingFollow Camera keeps the neutral line at a chosen height in view with dynamic top/underside transitions. Scene Height fixes it in world Y.
Waterline on screenNeutral height in the gameplay camera view: 0 = bottom, 0.5 = center, 1 = top. Follows movement and zoom without moving the physical waterline.
Framing heightWorld Y of the projection's neutral line. A flat surface at this height is edge-on. Below it shows the top; above it shows the underside.
Sorting layerWater sorting layer; actors use this layer when sorting override is enabled.
Water orderBase water sorting order; bottom is below it, actors render above it with optical composition.
Fit to cameraCrop the visible water mesh to the camera while retaining the source bounds and simulation domain.
Shared settings presetShared source settings. Enable local overrides to customize this body independently.
Animate in editorAnimate surface sprites while editing; projection still follows the gameplay camera.

Coordinates

X is width along the gameplay plane. Y is vertical height and depth. Virtual Z measures the distance from the near shore to the far shore. A Water Object on a virtual depth lane keeps its gameplay Transform.

Scene overrides

In example scenes, Scene Water Controls can override settings on several Water Sources. Edit or disable an override there before tuning one source separately.