Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


RoundToInt(Vector2)

Converts a Vector2 to a Vector2Int by doing a Round to each value.
Read time 1 minuteLast updated 5 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static Vector2Int RoundToInt(Vector2 v)

Parameters

The Vector2 to convert.

Returns

Type

Description

Vector2IntA rounded Vector2Int.

Remarks

As there is a conversion of float to integer, there is a loss of precision.