Vector3
Vector3 represents three-dimensional space as coordinates, physical quantities, or directions, containing three numerical components (x, y, and z). It is used in Unity for physics, animations, and transformations. Unity's Vector3 Documentation
Properties
Provides a Vector3 pointing towards the negative Z-axis, often used to designate a backward direction. Unity's Vector3.back Documentation
Represents a Vector3 pointing downwards along the negative Y-axis, typically used for downward directions. Unity's Vector3.down Documentation
Returns a Vector3 pointing towards the positive Z-axis, useful for designating a forward direction. Unity's Vector3.forward Documentation
Returns a Vector3 pointing in the negative X-axis direction, used to signify left direction in 3D space. Unity's Vector3.left Documentation
Provides the length of a Vector3, calculated as the Euclidean distance to (0,0,0), useful for distance calculations in 3D space. Unity's Vector3.magnitude Documentation
Generates a Vector3 with all components set to negative infinity, representing the smallest possible values in 3D space. Unity's Vector3.negativeInfinity Documentation
Returns a version of this Vector3 with a magnitude of one, maintaining its direction. Useful for unit direction vectors. Unity's Vector3.normalized Documentation
Generates a Vector3 object with all components set to 1, useful for pointing diagonally in 3D space. Unity's Vector3.one Documentation
Yields a Vector3 with all components set to positive infinity, useful for representing very large values. Unity's Vector3.positiveInfinity Documentation
Provides a Vector3 pointing towards the positive X-axis, recognized as the right direction in 3D space. Unity's Vector3.right Documentation
Returns the square of the magnitude, an alternative for performance-sensitive calculations where exact distance is not necessary. Unity's Vector3.sqrMagnitude Documentation
Offers a Vector3 pointing upwards along the positive Y-axis, handy for upward movements or orientations. Unity's Vector3.up Documentation
Represents the x-coordinate of the Vector3, allowing direct manipulation or reading of its x-component. Unity's Vector3.x Documentation
Corresponds to the y-coordinate of the Vector3, for manipulating or reading the y-component. Unity's Vector3.y Documentation
Represents the z-coordinate of the Vector3, used for direct manipulation or reading of the z-component. Unity's Vector3.z Documentation
Generates a Vector3 with zero values for all coordinates, representing the origin in 3D space or indicating no motion or rotation. Unity's Vector3.zero Documentation
Methods
Calculates the angle in degrees between two Vector3s, useful for determining the required rotation to align one Vector3 with another. Unity's Vector3.Angle Documentation
Limits the magnitude of a Vector3 to a specified maximum, useful for constraining movement or other vector magnitudes. Unity's Vector3.ClampMagnitude Documentation
Calculates the cross product of two Vector3 instances, resulting in a Vector3 perpendicular to both, used for finding normals or rotation axes. Unity's Vector3.Cross Documentation
Calculates the distance between two Vector3 points, typically used to determine how far apart two objects are in 3D space. Unity's Vector3.Distance Documentation
Calculates the Dot Product of two Vector3s, useful for determining directional alignment or the angle between vectors. Unity's Vector3.Dot Documentation
Parameters
other
Returns
Performs linear interpolation between two Vector3s, transitioning from 'a' to 'b' based on the 't' ratio. Unity's Vector3.Lerp Documentation
Similar to 'Lerp', this method performs linear interpolation between two points, but allows 't' to exceed the 0 to 1 range, enabling extrapolation. Unity's Vector3.LerpUnclamped Documentation
Returns the magnitude (length) of a Vector3, useful for distance calculations from the origin. Unity's Vector3.Magnitude Documentation
Parameters
vector
The Vector3 of which to calculate the magnitude.
Returns
The magnitude of the Vector3.
Produces a Vector3 from the largest x, y, and z components of two given Vector3s, useful for defining bounds or extents. Unity's Vector3.Max Documentation
Returns a Vector3 composed of the smallest x, y, and z components from two given Vector3s, useful for bounding calculations. Unity's Vector3.Min Documentation
Moves a Vector3 ('current') incrementally towards a target Vector3 ('target') at a specified 'maxDistanceDelta'. Unity's Vector3.MoveTowards Documentation
Adjusts the Vector3 to a length of one while maintaining its direction, useful for when only the direction is of interest. Unity's Vector3.Normalize Documentation
Adjusts the Vector3 to a length of one while maintaining its direction, useful for when only the direction is of interest. Unity's Vector3.Normalize Documentation
Returns
Projects a Vector3 onto another, useful for finding the component of one vector in the direction of another. Unity's Vector3.Project Documentation
Projects a Vector3 onto a plane defined by a normal orthogonal Vector3, useful for aligning objects to surfaces. Unity's Vector3.ProjectOnPlane Documentation
Reflects a Vector3 off a surface with a specified normal, useful for simulating reflections or ricochets. Unity's Vector3.Reflect Documentation
Gradually rotates a Vector3 'current' to align with a 'target' Vector3, with specified maximum rotation and magnitude change limits. Unity's Vector3.RotateTowards Documentation
Parameters
Returns
The Vector3 after rotating towards the target.
Creates a new Vector3 from the product of corresponding components of two given Vector3s, affecting the size without changing direction. Unity's Vector3.Scale Documentation
Creates a new Vector3 from the product of corresponding components of two given Vector3s, affecting the size without changing direction. Unity's Vector3.Scale Documentation
Parameters
scale
Returns
Changes the x, y, and z values of an existing Vector3 object, useful for simultaneous updates to all three components. Unity's Vector3.Set Documentation
Parameters
newX
The new value for the x-coordinate.
newY
The new value for the y-coordinate.
newZ
The new value for the z-coordinate.
Returns
Calculates the angle between two Vector3s with a sign indicating rotation direction around a given axis. Unity's Vector3.SignedAngle Documentation
Creates a smooth transition between two Vector3 points on a sphere's surface, ideal for smooth transitions in rotations or positions. Unity's Vector3.Slerp Documentation
Similar to 'Slerp' but allows the 't' value to exceed the 0 to 1 range, enabling extrapolation beyond the original points. Unity's Vector3.SlerpUnclamped Documentation
Calculates the square of the magnitude of a Vector3, often used for performance reasons in relative length comparisons. Unity's Vector3.SqrMagnitude Documentation
Parameters
vector
The Vector3 of which to calculate the square of the magnitude.
Returns
The square of the magnitude of the Vector3.
Updated 9 days ago