Legacy Documentation: Version 4.6(go to latest)
Language: English
  • C#
  • JS
  • Boo

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Rect.y

public float y;

Description

Top coordinate of the rectangle.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    public Rect rect = new Rect(10, 10, 100, 100);
    void Example() {
        print(rect.y);
        rect.x = 20;
    }
}