• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • Globals

    Vector4

    Represents a vector or a point in four-dimensional space, commonly used for RGBA values, 4D transforms, or 3D transformations with homogeneous coordinates. Unity's Vector4 Documentation

    Properties

    magnitude

    number
    ClientOnly
    ReadOnly

    Provides the length of the Vector4, useful for distance calculations or scaling vectors. Unity's Vector4.magnitude Documentation

    negativeInfinity

    ClientOnly
    ReadOnly

    Represents a Vector4 with all components set to negative infinity, useful for setting minimum limits. Unity's Vector4.negativeInfinity Documentation

    normalized

    ClientOnly
    ReadOnly

    Provides a normalized version of the Vector4, with a length of 1, useful for direction-only applications. Unity's Vector4.normalized Documentation

    one

    ClientOnly
    ReadOnly

    Represents a Vector4 with all components set to one, useful for certain mathematical operations. Unity's Vector4.one Documentation

    positiveInfinity

    ClientOnly
    ReadOnly

    Represents a Vector4 with all components set to positive infinity, useful for setting maximum limits. Unity's Vector4.positiveInfinity Documentation

    sqrMagnitude

    number
    ClientOnly
    ReadOnly

    Returns the square of the magnitude of the Vector4, a performance-friendly alternative for length comparisons. Unity's Vector4.sqrMagnitude Documentation

    w

    number
    ClientOnly

    Accesses the 'w' component of the Vector4, representing different dimensions or the 'Alpha' component in RGBA. Unity's Vector4.w Documentation

    x

    number
    ClientOnly

    Accesses the 'x' component of the Vector4, representing different dimensions or the 'Red' component in RGBA. Unity's Vector4.x Documentation

    y

    number
    ClientOnly

    Accesses the 'y' component of the Vector4, representing different dimensions or the 'Green' component in RGBA. Unity's Vector4.y Documentation

    z

    number
    ClientOnly

    Accesses the 'z' component of the Vector4, representing different dimensions or the 'Blue' component in RGBA. Unity's Vector4.z Documentation

    zero

    ClientOnly
    ReadOnly

    Represents a Vector4 with all components set to zero. Unity's Vector4.zero Documentation

    Methods

    Distance

    ClientOnly

    Computes the distance between two Vector4's, useful for object spacing or collision detection. Unity's Vector4.Distance Documentation

    Parameters

    The first Vector4.

    The second Vector4.

    Returns

    number

    Returns the distance between the two Vector4's.

    Dot

    ClientOnly

    Computes the dot product of two Vector4's, reflecting their angular relationship. Unity's Vector4.Dot Documentation

    Parameters

    The first Vector4.

    The second Vector4.

    Returns

    number

    Returns the dot product.

    Parameters

    other

    Returns

    boolean

    Lerp

    ClientOnly

    Performs Linear Interpolation between two Vector4's based on a parameter 't', useful for smooth transitions. Unity's Vector4.Lerp Documentation

    Parameters

    The starting Vector4.

    The ending Vector4.

    t
    number

    The interpolation factor.

    Returns

    Returns an interpolated Vector4.

    LerpUnclamped

    ClientOnly

    Similar to 'Lerp' but without clamping the 't' parameter, offering more freedom in interpolation. Unity's Vector4.LerpUnclamped Documentation

    Parameters

    The start Vector4.

    The end Vector4.

    t
    number

    The interpolation fraction.

    Returns

    Returns an unclamped interpolated Vector4.

    Magnitude

    ClientOnly

    Calculates the length of the Vector4, useful for finding the distance it spans in 4D space. Unity's Vector4.Magnitude Documentation

    Parameters

    The Vector4 to compute the magnitude for.

    Returns

    number

    Returns the magnitude of the Vector4.

    Max

    ClientOnly

    Returns a Vector4 with the largest components of two Vector4's, useful for limiting operations. Unity's Vector4.Max Documentation

    Parameters

    The first Vector4.

    The second Vector4.

    Returns

    Returns a Vector4 with the largest components.

    Min

    ClientOnly

    Returns a Vector4 with the smallest components of two Vector4's, useful for bounding box operations. Unity's Vector4.Min Documentation

    Parameters

    The first Vector4.

    The second Vector4.

    Returns

    Returns a Vector4 with the smallest components.

    MoveTowards

    ClientOnly

    Moves a Vector4 'current' towards 'target', limited by 'maxDistanceDelta', useful for smooth object movement. Unity's Vector4.MoveTowards Documentation

    Parameters

    current

    The current position.

    target

    The target position.

    maxDistanceDelta
    number

    The max distance to move.

    Returns

    Returns a Vector4 closer to the target.

    Normalize

    ClientOnly

    Transforms the Vector4 into a vector of same direction but with length 1, ideal for direction-only uses. Unity's Vector4.Normalize Documentation

    Parameters

    The Vector4 to normalize.

    Returns

    Normalize

    ClientOnly

    Transforms the Vector4 into a vector of same direction but with length 1, ideal for direction-only uses. Unity's Vector4.Normalize Documentation

    Returns

    void

    Project

    ClientOnly

    Projects a Vector4 onto another Vector4, useful for finding the nearest point on a defined line. Unity's Vector4.Project Documentation

    Parameters

    The Vector4 to project.

    The Vector4 to project onto.

    Returns

    Returns the projection of 'a' onto 'b'.

    Scale

    ClientOnly

    Multiplies two Vector4's component-wise, useful for component-wise data manipulation. Unity's Vector4.Scale Documentation

    Parameters

    The first Vector4.

    The second Vector4.

    Returns

    Returns a new Vector4 with the scaled components.

    Scale

    ClientOnly

    Multiplies two Vector4's component-wise, useful for component-wise data manipulation. Unity's Vector4.Scale Documentation

    Parameters

    scale

    Returns

    void

    Set

    ClientOnly

    Sets the 'x', 'y', 'z', and 'w' components of the Vector4, enhancing code readability and efficiency. Unity's Vector4.Set Documentation

    Parameters

    newX
    number

    The new 'x' component.

    newY
    number

    The new 'y' component.

    newZ
    number

    The new 'z' component.

    newW
    number

    The new 'w' component.

    Returns

    void

    SqrMagnitude

    ClientOnly

    Provides the square of the magnitude of the Vector4, an efficient method for length comparisons. Unity's Vector4.SqrMagnitude Documentation

    Parameters

    The Vector4 to compute the square of the magnitude for.

    Returns

    number

    Returns the square of the magnitude.

    SqrMagnitude

    ClientOnly

    Provides the square of the magnitude of the Vector4, an efficient method for length comparisons. Unity's Vector4.SqrMagnitude Documentation

    Returns

    number

    Returns the square of the magnitude.

    Updated 7 days ago

    PocketWorlds Icon

    © 2025 Pocket Worlds. All rights reserved.