operator /
Divides a vector by another vector.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Operator
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
operator /(Vector2, Vector2)
Divides a vector by another vector.
public static Vector2 operator /(Vector2 a, Vector2 b)
Parameters
Returns
Type | Description |
|---|---|
| Vector2 |
Remarks
Divides each component of by its matching component from .
aboperator /(Vector2, float)
Divides a vector by a number.
public static Vector2 operator /(Vector2 a, float d)
Parameters
Returns
Type | Description |
|---|---|
| Vector2 |
Remarks
Divides each component of by a number .
adExamples
using UnityEngine;public class Example : MonoBehaviour{ void Start() { // make the vector twice shorter: prints (0.5,1.0) print(new Vector2(1, 2) / 2.0f); }}