unity transfoprm position y change

C#
transform.position = new Vector3(transform.position.x, 0, transform.position.z);
Source

Also in C#: