Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


implicit operator Vector3(Vector3Int)

Converts a Vector3Int to a Vector3.
Read time 1 minuteLast updated 13 days ago

Definition

  • Type: Operator
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

implicit operator Vector3(Vector)

public static implicit operator Vector3(Vector3Int v)

Parameters

The Vector3Int to be converted to a Vector3.

Returns

Type

Description

Vector3The converted Vector3 result.

Remarks

An implicit conversion operator that converts an input Vector3Int value to a Vector3. The int components of the input are implicitly converted to floats when creating the result.

Examples

// Attach this script to a GameObject.using UnityEngine;public class Example : MonoBehaviour{ void Start() { Vector3Int a = new Vector3Int(4,5,6); Debug.Log("Input Vector3Int is: " + a.ToString()); Vector3 result = a; Debug.Log("Result Vector3 is: " + result.ToString()); }}