Getting Started With The Water System

Creating A Water Object

We create a water object from the Hierarchy's Create menu:

2D Object → Game2D Water Kit → Water Object

Create 2D Water Object from the Hierarchy's Create menu

Resizing The Water Object

We resize the water object right in the scene view using the Rect Tool, or we can just provide the width and the height in the water component inspector.

Resize Water Object in the component inspector

Script Reference

waterObject.MainModule.SetSize(new Vector2(width, height));

Sorting The Water Object Relative To Sprites

Before trying to sort the water object relative to sprites, we first need to make sure that the Rendering Queue property, under Rendering Options in the water material inspector, is set to Transparent.


The Rendering Queue property is set to Transparent by default.

Water Material Rendering Options

Then, under the Rendering Properties in the water component inspector, we specify the sorting layer as well as the order within that layer.

Water Component Rendering Options

Script Reference

waterObject.RenderingModule.SortingLayerID = SortingLayer.NameToID("Default");
waterObject.RenderingModule.SortingOrder = 0;


We will look into the other rendering properties later in this guide.