Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


operator +(Vector2, Vector2)

Adds two vectors.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Operator
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static Vector2 operator +(Vector2 a, Vector2 b)

Parameters

The first vector to add.

The second vector to add.

Returns

Type

Description

Vector2

Remarks

Adds corresponding components together.

Examples

using UnityEngine;using System.Collections;public class ExampleClass : MonoBehaviour{ void Start() { print(new Vector2(1, 2) + new Vector2(2, 3)); }}