• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • Globals

    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

    back

    ClientAndServer
    ReadOnly

    Provides a Vector3 pointing towards the negative Z-axis, often used to designate a backward direction. Unity's Vector3.back Documentation

    down

    ClientAndServer
    ReadOnly

    Represents a Vector3 pointing downwards along the negative Y-axis, typically used for downward directions. Unity's Vector3.down Documentation

    forward

    ClientAndServer
    ReadOnly

    Returns a Vector3 pointing towards the positive Z-axis, useful for designating a forward direction. Unity's Vector3.forward Documentation

    left

    ClientAndServer
    ReadOnly

    Returns a Vector3 pointing in the negative X-axis direction, used to signify left direction in 3D space. Unity's Vector3.left Documentation

    magnitude

    number
    ClientAndServer
    ReadOnly

    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

    negativeInfinity

    ClientAndServer
    ReadOnly

    Generates a Vector3 with all components set to negative infinity, representing the smallest possible values in 3D space. Unity's Vector3.negativeInfinity Documentation

    normalized

    ClientAndServer
    ReadOnly

    Returns a version of this Vector3 with a magnitude of one, maintaining its direction. Useful for unit direction vectors. Unity's Vector3.normalized Documentation

    one

    ClientAndServer
    ReadOnly

    Generates a Vector3 object with all components set to 1, useful for pointing diagonally in 3D space. Unity's Vector3.one Documentation

    positiveInfinity

    ClientAndServer
    ReadOnly

    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

    sqrMagnitude

    number
    ClientAndServer
    ReadOnly

    Returns the square of the magnitude, an alternative for performance-sensitive calculations where exact distance is not necessary. Unity's Vector3.sqrMagnitude Documentation

    up

    ClientAndServer
    ReadOnly

    Offers a Vector3 pointing upwards along the positive Y-axis, handy for upward movements or orientations. Unity's Vector3.up Documentation

    x

    number
    ClientAndServer

    Represents the x-coordinate of the Vector3, allowing direct manipulation or reading of its x-component. Unity's Vector3.x Documentation

    y

    number
    ClientAndServer

    Corresponds to the y-coordinate of the Vector3, for manipulating or reading the y-component. Unity's Vector3.y Documentation

    z

    number
    ClientAndServer

    Represents the z-coordinate of the Vector3, used for direct manipulation or reading of the z-component. Unity's Vector3.z Documentation

    zero

    ClientAndServer
    ReadOnly

    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

    Angle

    ClientAndServer

    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

    Parameters

    The origin Vector3 for angle measurement.

    The destination Vector3 for angle measurement.

    Returns

    number

    The angle in degrees between the two Vector3s.

    ClampMagnitude

    ClientAndServer

    Limits the magnitude of a Vector3 to a specified maximum, useful for constraining movement or other vector magnitudes. Unity's Vector3.ClampMagnitude Documentation

    Parameters

    vector

    The Vector3 to clamp.

    maxLength
    number

    The maximum length to which the vector's magnitude will be clamped.

    Returns

    A new Vector3 with its magnitude clamped to the specified maximum length.

    Cross

    ClientAndServer

    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

    Parameters

    The first Vector3 to cross.

    The second Vector3 to cross.

    Returns

    The cross product of the two Vector3s.

    Distance

    ClientAndServer

    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

    Parameters

    The first Vector3 point.

    The second Vector3 point.

    Returns

    number

    The distance between the two Vector3 points.

    Dot

    ClientAndServer

    Calculates the Dot Product of two Vector3s, useful for determining directional alignment or the angle between vectors. Unity's Vector3.Dot Documentation

    Parameters

    The first Vector3 for the dot product.

    The second Vector3 for the dot product.

    Returns

    number

    The dot product of the two Vector3s.

    Parameters

    other

    Returns

    boolean

    Lerp

    ClientAndServer

    Performs linear interpolation between two Vector3s, transitioning from 'a' to 'b' based on the 't' ratio. Unity's Vector3.Lerp Documentation

    Parameters

    The starting Vector3 point.

    The ending Vector3 point.

    t
    number

    The interpolation factor, in the range 0 to 1.

    Returns

    A new Vector3 point interpolated between 'a' and 'b'.

    LerpUnclamped

    ClientAndServer

    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

    Parameters

    The starting Vector3 point.

    The ending Vector3 point.

    t
    number

    The interpolation factor, not limited to between 0 and 1.

    Returns

    A new Vector3 point interpolated (or extrapolated) between 'a' and 'b'.

    Magnitude

    ClientAndServer

    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

    number

    The magnitude of the Vector3.

    Max

    ClientAndServer

    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

    Parameters

    The first of two Vector3s to compare.

    The second of two Vector3s to compare.

    Returns

    A Vector3 composed of the largest components of the two compared Vector3s

    Min

    ClientAndServer

    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

    Parameters

    The first Vector3 for comparison.

    The second Vector3 for comparison.

    Returns

    A Vector3 made up of the smallest components from the two input Vector3s.

    MoveTowards

    ClientAndServer

    Moves a Vector3 ('current') incrementally towards a target Vector3 ('target') at a specified 'maxDistanceDelta'. Unity's Vector3.MoveTowards Documentation

    Parameters

    current

    The current Vector3 to move.

    target

    The target Vector3 to move towards.

    maxDistanceDelta
    number

    The maximum distance the Vector3 can move in one call.

    Returns

    A Vector3 moved towards the target.

    Normalize

    ClientAndServer

    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

    Parameters

    value

    The Vector3 to normalize.

    Returns

    A normalized version of the input Vector3.

    Normalize

    ClientAndServer

    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

    void

    Project

    ClientAndServer

    Projects a Vector3 onto another, useful for finding the component of one vector in the direction of another. Unity's Vector3.Project Documentation

    Parameters

    vector

    The Vector3 being projected.

    onNormal

    The Vector3 on which the projection occurs.

    Returns

    The projection of the first Vector3 onto the second.

    ProjectOnPlane

    ClientAndServer

    Projects a Vector3 onto a plane defined by a normal orthogonal Vector3, useful for aligning objects to surfaces. Unity's Vector3.ProjectOnPlane Documentation

    Parameters

    vector

    The Vector3 being projected onto a plane.

    planeNormal

    The normal Vector3 of the plane onto which the projection occurs.

    Returns

    The Vector3 after being projected onto a plane.

    Reflect

    ClientAndServer

    Reflects a Vector3 off a surface with a specified normal, useful for simulating reflections or ricochets. Unity's Vector3.Reflect Documentation

    Parameters

    inDirection

    The incoming Vector3 to reflect.

    inNormal

    The normal Vector3 off which to reflect.

    Returns

    The reflected Vector3.

    RotateTowards

    ClientOnly

    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

    current

    The current Vector3 from which rotation starts.

    target

    The target Vector3 towards which rotation is aimed.

    maxRadiansDelta
    number

    Maximum rotation allowed in radians.

    maxMagnitudeDelta
    number

    Maximum change in magnitude allowed.

    Returns

    The Vector3 after rotating towards the target.

    Scale

    ClientAndServer

    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

    The first Vector3 used for scaling.

    The second Vector3 used for scaling.

    Returns

    Scale

    ClientAndServer

    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

    void

    Set

    ClientAndServer

    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
    number

    The new value for the x-coordinate.

    newY
    number

    The new value for the y-coordinate.

    newZ
    number

    The new value for the z-coordinate.

    Returns

    void

    SignedAngle

    ClientAndServer

    Calculates the angle between two Vector3s with a sign indicating rotation direction around a given axis. Unity's Vector3.SignedAngle Documentation

    Parameters

    The Vector3 from where the angle measurement starts.

    The Vector3 to which the angle measurement is made.

    The axis around which the rotation angle is measured.

    Returns

    number

    The signed angle in degrees between the two Vector3s.

    Slerp

    ClientOnly

    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

    Parameters

    The starting Vector3 point.

    The ending Vector3 point.

    t
    number

    The interpolation factor between 0 and 1.

    Returns

    A Vector3 point along the shortest path between 'a' and 'b'.

    SlerpUnclamped

    ClientOnly

    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

    Parameters

    The starting Vector3 point.

    The ending Vector3 point.

    t
    number

    An extrapolation factor beyond 0 and 1.

    Returns

    A new Vector3 point potentially extrapolated beyond 'b'.

    Parameters

    current
    target
    currentVelocity
    smoothTime
    number

    Parameters

    current
    target
    currentVelocity
    smoothTime
    number
    maxSpeed
    number

    Parameters

    current
    target
    currentVelocity
    smoothTime
    number
    maxSpeed
    number
    deltaTime
    number

    SqrMagnitude

    ClientAndServer

    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

    number

    The square of the magnitude of the Vector3.

    Updated 9 days ago

    PocketWorlds Icon

    © 2025 Pocket Worlds. All rights reserved.