Legacy Documentation: Version 5.2
LanguageEnglish
  • C#
  • JS

Script language

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

Vector2.operator +

Switch to Manual
public static Vector2 operator +(Vector2 a, Vector2 b);

Parameters

Description

Adds two vectors.

Adds corresponding components together.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Example() { print(new Vector2(1, 2) + new Vector2(2, 3)); } }