Legacy Documentation: Version 5.2
LanguageEnglish
  • C#
  • JS

Script language

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

Rect.y

Switch to Manual
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; } }