In this tutorial, we go over how to use our brand new Vector Field Plugin for unity. We re-coded this plugin from scratch to create what is now version 2.0.T. Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.
![Vector2 Vector2](https://docs.unity3d.com/StaticFiles/ScriptRefImages/EditorGUIVector2Field.png)
Unity Vector2 Api
Author: Eric Haines (Eric5h5)
Description
![Unity Vector2 Unity Vector2](/uploads/1/3/4/8/134882129/601951378.jpg)
Draws a vector line on the screen based on normalized viewport coordinates. The line can have an arbitrary width, color, and number of segments, and is defined by an array of Vector2s. Requires Unity Pro, since it uses the GL class.
Usage
Put this script on a camera. The public variables control the number of points in the line, its color, its thickness, and whether the line should be drawn or not (because disabling the script doesn't stop the OnPostRender function from running). The linePoints array is an array of Vector2s in normalized viewport coordinates (i.e. (0, 0) is the lower-left corner of the screen and (1,1) is the upper-right). Currently only one contiguous line is supported, but it would be easy enough to modify it to use an array of Vector2s in order to draw multiple separate lines, if so inclined. A sample routine, which results in the image above:
Vector3 Unity
This should be in the same script with the VectorLine code, below.
Unity Vector2 Lerp
VectorLine.js
VectorLine.cs
VectorLines.cs
Unity Vector2 C#
The following is a version of the C# script that handles multiple lines at once, updated via UpdateLines() each frame.
Unity Vector2 Angle
Retrieved from 'http://wiki.unity3d.com/index.php?title=VectorLine&oldid=18195'