SCRIPT REFERENCE
Pixel Water
Basic Foldout
These settings control the size and interaction layers of the water body.
Size
A Vector2 controlling the width (X) and maximum height (Y) of the water area.
Modifying this regenerates the mesh.
Fill
A float (0 to 1) representing the vertical fill percentage.
1.0 is full height defined by Size.y, while lower values lower the water surface level
Interaction Layer Mask
Defines which layers contain non-trigger colliders that can physically interact with the water (create waves, splashes, etc.).
Interaction Trigger Layer Mask
Defines which layers contain trigger colliders that can interact with the water.
Rendering Foldout
These parameters control the visual appearance of the water, passed directly to the shader.
Water Color Enabled
The interval range for the character to play an eye blink animation.
Water Color Shallow
The color gradient from the water surface (shallow) to the bottom (deep).
The color is blended using alpha blend.
Water Color Deep
The color gradient from the water surface (shallow) to the bottom (deep).
The color is blended using alpha blend.
Underwater Tint Enabled
Toggles the tint applied to the content behind the water.
Underwater Tint Shallow
The color tint applied to content behind the water, grading from surface (shallow) to bottom (deep).
The color is blended using multiply.
Underwater Tint Deep
The color tint applied to content behind the water, grading from surface (shallow) to bottom (deep).
The color is blended using multiply.
Surface Enabled
Toggles the rendering of the surface line at the top of the water.
The surface line is divided into upper and lower part.
Surface Color Upper
Color of the upper part of the surface line.
Surface Color Lower
Color of the lowerpart of the surface line.
Surface Thickness Upper
Controls how thick the upper surface line is rendered.
Surface Thickness Lower
Controls how thick the lower surface line is rendered.
Surface Distortion Mul
Multiplier for the distortion effect of the surface line.
Distortion Enabled
Toggles the refraction/distortion effect of the behind water content.
Distortion Speed
Controls the animation speed of the effect.
Distortion Scale
Controls the texture scale of the effect.
Distortion Strength
Controls the intensity of the effect.
Blur Enabled
Toggles the blur effect for the behind water content.
Blur Amount Shallow
The blur effect intensity, grading from surface (shallow) to bottom (deep).
Blur Amount Deep
The blur effect intensity, grading from surface (shallow) to bottom (deep).
Light Shaft Enabled
Toggles the effect of light beams shining down into the water.
Light Shaft Color
The color and transparency of the light beams.
The color is blended using add mode.
Light Shaft Scale
Controls the size of the light rays.
Light Shaft Power
The power applied to the alpha of the light rays.
Light Shaft Tilt
Controls the angle of the light rays.
Light Shaft Depth
Controls the fade-depth of the light rays.
Light Shaft Speed
Controls the animation speed of the light rays.
Wave Enabled
Toggles the physics-based spring simulation for surface waves.
Wave Influence Mul
Multiplier for how much an object's velocity (X and Y) impacts the water surface to create waves.
Wave Influence Decay Depth
The depth at which an object no longer creates surface waves (objects deep underwater won't disturb the surface).
Wave Tension
Controls the stiffness of the wave.
Higher values make the water surface snap back to rest position faster.
Wave Damping
Controls friction of the wave.
Higher values make waves settle and stop oscillating faster.
Avoid setting it to near zero.
Wave Spread
Controls how fast a wave ripple travels to neighboring vertices.
Wave Spread Iteration
The quality/smoothness of the wave propagation calculation (higher is more accurate but more expensive).
Wave Speed Mul
Global speed multiplier for the wave physics simulation.
Wave Velocity Limit
Clamps the maximum speed of the wave.
Wave Limit
Clamps the maximum amplitude of the wave.
Ambient Wave Enabled
Toggles the constant background waves.
Ambient Wave Mul
Global intensity multiplier for the ambient wave.
Ambient Wave Speed
Parameters that allow layering up to 4 different wave noises (x, y, z, w) for complex, non-repeating surface wave motion.
Ambient Wave Frequency
Parameters that allow layering up to 4 different wave noises (x, y, z, w) for complex, non-repeating surface wave motion.
Ambient Wave Amplitude
Parameters that allow layering up to 4 different wave noises (x, y, z, w) for complex, non-repeating surface wave motion.
FX Foldout
Controls particle and prefab instantiation when objects interact with the water.
Bubble Enabled
Toggles bubble effect generation.
Bubble Duration Mul
Multiplier for bubble emit duration.
Bubble Amount Mul
Multiplier for bubble emit amount.
Bubble Color Outline
The outline color of the generated bubble.
Bubble Color Fill
The fill color of the generated bubble.
Bubble Prefab
The prefab instantiated to create bubbles. (must contain PixelWaterBubble script).
Splash Enabled
Toggles splash effect generation.
Splash On Enter
Whether to generate splash when objects enter the water.
Splash On Exit
Whether to generate splash when objects exit the water.
Splash Color Light
The color of the lighter part of the splash.
Splash Color Dark
The color of the darker part of the splash.
Splash Color Outline
The outline color of the splash
Splash Configs
A list of SplashConfig objects defining different splash types based on object size.
Size Range: The object size range (min/max) that triggers this specific splash.
Min Speed: Minimum entry velocity required to trigger this splash.
Min Depth: Minimum water depth required.
Splash Prefab: The visual prefab to spawn.
Surface Particle Enabled
Toggles continuous particles on the water surface.
For example, surface bubble and spark of the lava preset.
Surface Particle Configs
A list of ParticleConfig objects defining particle systems used as the surface particle.
The script automatically changes their emission shape to match the water surface.
Particle System: The particle system to control.
Emit Mul Per Unit: The emit rate multiplier per unit to ensure if you make the water area larger, the surface particle also emit more particles.
In Water Particle Enabled
Toggles continuous particles inside the water volume
For example, the floating debris in the muddy preset.
In Water Particle Configs
A list of ParticleConfig objects defining particle systems used as the surface particle.
The script automatically changes their emission shape to match the water surface.
Particle System: The particle system to control.
Emit Mul Per Unit: The emit rate multiplier per unit to ensure if you make the water area larger, the surface particle also emit more particles.
Physics Foldout
Controls the custom drag (resistance) applied to objects inside the water.
Drag Enabled
Toggles the custom drag force.
Note that we do not use the standard Unity BuoyancyEffector2D drag here, as this custom implementation scale with the velocity, making it more physically correct.
Drag Linear
How much linear velocity is slowed down.
Drag Angular
How much rotation (angular velocity) is slowed down.
Event Foldout
This foldout contains some Unity events that you can use to trigger your own function.
On Splash
A Unity Event (int level, Vector3 position) invoked whenever a splash occurs.
You can hook sound effects or other scripts to this event.
Pixel Water Renderer Feature
Behind Water Mask
The layer mask of the objects that need to be rendered behind the water.
You must not include the water itself in this layer mask.
Background Color
The color to use if there is nothing behind the water.
Downsample
Downsample rate for capturing the behind water texture. Higher value improves performance but make behind water content more blury.
Last updated