operator -(Vector3)
Negates a vector.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Operator
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
public static Vector3 operator -(Vector3 a)
Parameters
The vector to negate.
Returns
Type | Description |
|---|---|
| Vector3 |
Remarks
Each component in the result is negated.
Examples
// prints (-1.0f, -2.0f, -3.0f)using UnityEngine;using System.Collections;public class ExampleClass : MonoBehaviour{ void Example() { print(-new Vector3(1.0f, 2.0f, 3.0f)); }}