Version: 2018.3 (switch to 2019.1)
LanguageEnglish
  • C#

Vector4.this[int]

public float this[int];

Description

Access the x, y, z, w components using [0], [1], [2], [3] respectively.

using UnityEngine;

public class Example : MonoBehaviour { void Start() { Vector4 p = new Vector4(); p[3] = 5; // the same as p.w = 5 } }

Did you find this page useful? Please give it a rating: